diff options
Diffstat (limited to 'ychat-0.8.0/src/mods/commands/yc_invisible.cpp')
| -rwxr-xr-x | ychat-0.8.0/src/mods/commands/yc_invisible.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ychat-0.8.0/src/mods/commands/yc_invisible.cpp b/ychat-0.8.0/src/mods/commands/yc_invisible.cpp new file mode 100755 index 0000000..58a8912 --- /dev/null +++ b/ychat-0.8.0/src/mods/commands/yc_invisible.cpp @@ -0,0 +1,31 @@ +#include "../../incl.h" +#include "../../chat/room.h" +#include "../../chat/user.h" + +using namespace std; + +extern "C" +{ + int extern_function(void *v_arg) + { + container *c=(container *)v_arg; + + user* p_user = (user*) c->elem[1]; // the corresponding user + conf* p_conf = (conf*) ((dynamic_wrap*)c->elem[3])->CONF; + + bool b_invisible = p_user->get_invisible(); + + string s_msg = b_invisible + ? p_conf->get_elem("chat.msgs.setmodeinvisible") + + "<br>\n" + : p_conf->get_elem("chat.msgs.unsetmodeinvisible") + + "<br>\n"; + + p_user->set_invisible( !b_invisible ); + p_user->get_room()->reload_onlineframe(); + p_user->msg_post ( &s_msg ); + + return 0; + } +} + |
