summaryrefslogtreecommitdiff
path: root/ychat-0.6/mods/commands/yc_me.cpp
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:41 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:41 +0200
commit9cd3ccffd5372dfde3af478e3f832f18db4be3f1 (patch)
tree631c295a4a4a16b57502b847626763a279bf6df7 /ychat-0.6/mods/commands/yc_me.cpp
parent13aaf70af703748fe096e0664c305cd202637ad2 (diff)
tagging tags
Diffstat (limited to 'ychat-0.6/mods/commands/yc_me.cpp')
-rw-r--r--ychat-0.6/mods/commands/yc_me.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/ychat-0.6/mods/commands/yc_me.cpp b/ychat-0.6/mods/commands/yc_me.cpp
new file mode 100644
index 0000000..5ba5298
--- /dev/null
+++ b/ychat-0.6/mods/commands/yc_me.cpp
@@ -0,0 +1,38 @@
+#include <iostream>
+#include "../../user.h"
+#include "../../room.h"
+/*
+ gcc -shared -o yc_name.so yc_name.cpp
+*/
+
+using namespace std;
+
+typedef vector<string> str_vector;
+
+extern "C" {
+ export int extern_function(void *v_arg);
+ int valid_color( string );
+
+ int extern_function(void *v_arg)
+ {
+ container *c=(container *)v_arg;
+
+ user *p_user = (user*) c->elem[1]; // the corresponding user
+ str_vector *params= (str_vector*) c->elem[2]; // param array
+
+ string s_msg = "<i><font color=\"#" +p_user->get_col1() + "\">"
+ + p_user->get_name() + " ";
+
+ if ( ! params->empty() )
+ {
+ str_vector::iterator iter = params->begin();
+ for ( iter = params->begin(); iter != params->end(); iter++ )
+ s_msg.append( *iter + " " );
+ }
+
+ s_msg.append( "</font></i><br>\n" );
+ p_user->get_room()->msg_post( &s_msg );
+
+ }
+}
+