summaryrefslogtreecommitdiff
path: root/src/user.cpp
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:45 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:45 +0200
commitd34015c5ba231b95de20e9fcd7a33c5b2b9a1006 (patch)
treeceac33bd27e3b1158a0ac4e17f7fd7e5e6473fea /src/user.cpp
parentc507ce3198ea4d822832cc8740f0128df8873c02 (diff)
tagging ychat-0.5.3ychat-0.5.3
Diffstat (limited to 'src/user.cpp')
-rwxr-xr-xsrc/user.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/user.cpp b/src/user.cpp
index 7fd5858..1250254 100755
--- a/src/user.cpp
+++ b/src/user.cpp
@@ -5,6 +5,7 @@
#include "user.h"
#include "s_conf.h"
+#include "s_modl.h"
#include "s_tool.h"
using namespace std;
@@ -113,6 +114,34 @@ user::set_sock( int i_sock )
}
void
+user::command( string &s_command )
+{
+
+ auto unsigned int pos = s_command.find( "/" );
+ while( pos != string::npos )
+ {
+ s_command.replace( pos, 1, "" );
+ pos = s_command.find( "/" );
+ }
+
+ string s_mod( "cmnd/yc_" );
+ s_mod.append( s_command ).append( ".so" );
+
+ dynmod *mod = s_modl::get
+ ().get_module( s_mod );
+
+ if ( mod == NULL )
+ {
+ msg_post( new string( s_lang::get
+ ().get_val( "ERRORCMD" ) ) );
+ return;
+ }
+
+ // execute the module.
+ ( *(mod->the_func) ) ( (void*) this );
+}
+
+void
user::renew_stamp( )
{
pthread_mutex_lock ( &mut_l_time );