diff options
| author | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-07-01 20:17:31 +0200 |
|---|---|---|
| committer | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-07-01 20:17:31 +0200 |
| commit | e5ff213596011443c467a5257ed6fe5847265d7f (patch) | |
| tree | b7322e71dd7f2fb1ff6824cb20acc706b84d06c5 /src/mods | |
| parent | 0b4ccf59b27f0a8de71b10120b50c916fdbc46a0 (diff) | |
| parent | 13aaf70af703748fe096e0664c305cd202637ad2 (diff) | |
Mergeychat-0.8
Diffstat (limited to 'src/mods')
42 files changed, 578 insertions, 52 deletions
diff --git a/src/mods/Makefile.mods.in b/src/mods/Makefile.mods.in new file mode 100644 index 0000000..92a5409 --- /dev/null +++ b/src/mods/Makefile.mods.in @@ -0,0 +1,19 @@ +SRCS=$(shell find ./ -name '*.cpp') +MODS=$(addprefix ../../../mods/@CATEGORY@/, $(SRCS:.cpp=.so)) +CXX=@CXX@ +CXXFLAGS=@CXXFLAGS@ +all: mods +${MODS}: + @if ! test -d `dirname $@`; then mkdir -p `dirname $@`; fi + @${CXX} ${CXXGLAGS} -shared -s -o $@ ` \ + echo $(notdir $@) | sed s/.so/.cpp/` + @echo "mods:@CATEGORY@:`basename $@ | sed s/\.so// | sed s/yc_//` (` \ + du -hs $@ | awk '{ print $$1 }'`) " +infotext: + @echo "===> Compiling @CATEGORY@ modules" +mods: infotext ${MODS} + @echo "===> Num of @CATEGORY@ modules: `ls \ + ../../../mods/@CATEGORY@/*.so | wc -l | sed 's/ //g;'`" +clean: + @echo "===> Cleaning @CATEGORY@ modules" + @if test -d ../../../mods/@CATEGORY@; then rm -Rf ../../../mods/@CATEGORY@; fi diff --git a/src/mods/commands/yc_about.cpp b/src/mods/commands/yc_about.cpp index b4449a1..5fedb6d 100644 --- a/src/mods/commands/yc_about.cpp +++ b/src/mods/commands/yc_about.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_about.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_all.cpp b/src/mods/commands/yc_all.cpp index 24edb56..4fae79d 100644 --- a/src/mods/commands/yc_all.cpp +++ b/src/mods/commands/yc_all.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_all.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_away.cpp b/src/mods/commands/yc_away.cpp index 0e879fc..b66b82c 100644 --- a/src/mods/commands/yc_away.cpp +++ b/src/mods/commands/yc_away.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_away.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_ban.cpp b/src/mods/commands/yc_ban.cpp new file mode 100644 index 0000000..03e6470 --- /dev/null +++ b/src/mods/commands/yc_ban.cpp @@ -0,0 +1,107 @@ +/*:* + *: File: ./src/mods/commands/yc_bannick.cpp + *: + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT + *: + *: Copyright (C) 2003 Paul C. Buetow, Volker Richter + *: Copyright (C) 2004 Paul C. Buetow + *: Copyright (C) 2005 EXA Digital Solutions GbR + *: + *: This program is free software; you can redistribute it and/or + *: modify it under the terms of the GNU General Public License + *: as published by the Free Software Foundation; either version 2 + *: of the License, or (at your option) any later version. + *: + *: This program is distributed in the hope that it will be useful, + *: but WITHOUT ANY WARRANTY; without even the implied warranty of + *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *: GNU General Public License for more details. + *: + *: You should have received a copy of the GNU General Public License + *: along with this program; if not, write to the Free Software + *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *:*/ + +#include "../../chat/user.h" +#include "../../chat/room.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 + vector<string> *params = (vector<string>*) c->elem[2]; // param array + chat* p_chat = (chat*) ((dynamic_wrap*)c->elem[3])->CHAT; + conf* p_conf = (conf*) ((dynamic_wrap*)c->elem[3])->CONF; + timr* p_timr = (timr*) ((dynamic_wrap*)c->elem[3])->TIMR; + + if ( ! params->empty() ) + { + vector<string>::iterator iter = params->begin(); + string s_bannick_user(*iter); + //if (string.find(".") != string::npos) { + //} + + bool b_found; + user* p_bannick_user = p_chat->get_user( s_bannick_user, b_found ); + + if ( b_found ) + { + string s_reason = ""; + for ( iter++; iter != params->end(); iter++ ) + s_reason.append( *iter + " " ); + + bool b_reason = s_reason.length() > 0; + + string s_retmsg = p_chat->ban_nick(s_bannick_user, string("( " + p_user->get_colored_name() + (b_reason ? ": " : "") + s_reason + " )")); + if (!s_retmsg.empty()) { + string s_msg = "<font color=\"#" + + p_conf->get_elem("chat.html.errorcolor") + + "\"><b>" + + s_bannick_user + "</b> " + + p_conf->get_elem("chat.msgs.err.alreadybanned") + + " " + s_retmsg + + "</font><br>\n"; + + p_user->msg_post( &s_msg ); + return 0; + } + + string s_time = ""; + if ( p_conf->get_elem("chat.printalwaystime") == "true" ) + s_time = p_timr->get_time() + " "; + + string s_msg = s_time + "<i> " + p_user->get_colored_bold_name() + " " + p_conf->get_elem("chat.msgs.ban") + " " + + p_bannick_user->get_colored_bold_name(); + + if (b_reason) + s_msg.append( " ( " + s_reason + " )"); + + s_msg.append("</i><br>\n"); + + p_user->msg_post(s_msg); + if (! p_user->same_rooms(p_bannick_user) ) + p_bannick_user->msg_post(s_msg); + + } + else + { + string s_msg = "<font color=\"#" + + p_conf->get_elem("chat.html.errorcolor") + + "\"><b>" + + s_bannick_user + "</b> " + + p_conf->get_elem("chat.msgs.err.notavailable") + + "</font><br>\n"; + + p_user->msg_post( &s_msg ); + } + } + + return 0; + } +} + diff --git a/src/mods/commands/yc_banned.cpp b/src/mods/commands/yc_banned.cpp new file mode 100644 index 0000000..feeb19c --- /dev/null +++ b/src/mods/commands/yc_banned.cpp @@ -0,0 +1,65 @@ +/*:* + *: File: ./src/mods/commands/yc_banned.cpp + *: + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT + *: + *: Copyright (C) 2003 Paul C. Buetow, Volker Richter + *: Copyright (C) 2004 Paul C. Buetow + *: Copyright (C) 2005 EXA Digital Solutions GbR + *: + *: This program is free software; you can redistribute it and/or + *: modify it under the terms of the GNU General Public License + *: as published by the Free Software Foundation; either version 2 + *: of the License, or (at your option) any later version. + *: + *: This program is distributed in the hope that it will be useful, + *: but WITHOUT ANY WARRANTY; without even the implied warranty of + *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *: GNU General Public License for more details. + *: + *: You should have received a copy of the GNU General Public License + *: along with this program; if not, write to the Free Software + *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *:*/ + +#include "../../chat/user.h" +#include "../../chat/chat.h" +#include "../../maps/shashmap.h" + +using namespace std; + +extern "C" +{ + int extern_function(void *v_arg) + { + container *c=(container *)v_arg; + + user *p_user = (user*) c->elem[1]; + chat* p_chat = (chat*) ((dynamic_wrap*)c->elem[3])->CHAT; + conf* p_conf = (conf*) ((dynamic_wrap*)c->elem[3])->CONF; + + shashmap<string>* map_banned_nicks = p_chat->get_map_banned_nicks(); + string s_msg(""); + + if ( map_banned_nicks->size() > 0 ) + { + vector<string>* vec_keys = map_banned_nicks->get_key_vector(); + + for (vector<string>::iterator iter = vec_keys->begin(); iter != vec_keys->end(); ++iter) + s_msg.append(*iter + ": " + map_banned_nicks->get_elem(*iter) + "<br>\n"); + + } + else + { + s_msg = "<font color=\"#" + + p_conf->get_elem("chat.html.errorcolor") + + "\">" + + p_conf->get_elem("chat.msgs.err.nobanned") + + "</font><br>\n"; + } + + p_user->msg_post( &s_msg ); + return 0; + } +} + diff --git a/src/mods/commands/yc_col.cpp b/src/mods/commands/yc_col.cpp index dca1bde..11f93b6 100644 --- a/src/mods/commands/yc_col.cpp +++ b/src/mods/commands/yc_col.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_col.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_compopt.cpp b/src/mods/commands/yc_compopt.cpp index 43e5e1b..5850cea 100644 --- a/src/mods/commands/yc_compopt.cpp +++ b/src/mods/commands/yc_compopt.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_compopt.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_debug.cpp b/src/mods/commands/yc_debug.cpp new file mode 100644 index 0000000..9f770b7 --- /dev/null +++ b/src/mods/commands/yc_debug.cpp @@ -0,0 +1,67 @@ +/*:* + *: File: ./src/mods/commands/yc_msg.cpp + *: + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT + *: + *: Copyright (C) 2003 Paul C. Buetow, Volker Richter + *: Copyright (C) 2004 Paul C. Buetow + *: Copyright (C) 2005 EXA Digital Solutions GbR + *: + *: This program is free software; you can redistribute it and/or + *: modify it under the terms of the GNU General Public License + *: as published by the Free Software Foundation; either version 2 + *: of the License, or (at your option) any later version. + *: + *: This program is distributed in the hope that it will be useful, + *: but WITHOUT ANY WARRANTY; without even the implied warranty of + *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *: GNU General Public License for more details. + *: + *: You should have received a copy of the GNU General Public License + *: along with this program; if not, write to the Free Software + *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *:*/ + +#include "../../chat/user.h" +#include "../../chat/room.h" +/* + gcc -shared -o yc_name.so yc_name.cpp +*/ + +using namespace std; + +// THIS MODULE IS FOR DEBUGGING PURPOSE ONLY, IT DOESNT HAVE ANY OTHER USE! + +extern "C" +{ + 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 + vector<string> *params = (vector<string>*) c->elem[2]; // param array + chat* p_chat = (chat*) ((dynamic_wrap*)c->elem[3])->CHAT; + sman* p_sman = (sman*) ((dynamic_wrap*)c->elem[3])->SMAN; + + if ( ! params->empty() ) + { + vector<string>::iterator iter = params->begin(); + string s_test_user( *iter ); + bool b_found; + user* p_whisper_user = p_chat->get_user( s_test_user, b_found ); + sess *p_sess = p_sman->get_elem(p_user->get_tmpid()); + + string s_msg = "DEBUG-A: " + tool::int2string(reinterpret_cast<int>(p_sess->get_user())) + "<br>"; + p_user->msg_post( &s_msg ); + + //p_user->debug(); + s_msg = "DEBUG-B: " + tool::int2string(reinterpret_cast<int>(p_sess->get_user())) + "<br>"; + p_user->msg_post( &s_msg ); + } + + return 0; + } +} + diff --git a/src/mods/commands/yc_exec.cpp b/src/mods/commands/yc_exec.cpp index 6f2d533..7751566 100644 --- a/src/mods/commands/yc_exec.cpp +++ b/src/mods/commands/yc_exec.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_exec.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_fake.cpp b/src/mods/commands/yc_fake.cpp index 3eb1442..e8dd230 100644 --- a/src/mods/commands/yc_fake.cpp +++ b/src/mods/commands/yc_fake.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_fake.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_gag.cpp b/src/mods/commands/yc_gag.cpp new file mode 100644 index 0000000..e58a22d --- /dev/null +++ b/src/mods/commands/yc_gag.cpp @@ -0,0 +1,92 @@ +/*:* + *: File: ./src/mods/commands/yc_gag.cpp + *: + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT + *: + *: Copyright (C) 2003 Paul C. Buetow, Volker Richter + *: Copyright (C) 2004 Paul C. Buetow + *: Copyright (C) 2005 EXA Digital Solutions GbR + *: + *: This program is free software; you can redistribute it and/or + *: modify it under the terms of the GNU General Public License + *: as published by the Free Software Foundation; either version 2 + *: of the License, or (at your option) any later version. + *: + *: This program is distributed in the hope that it will be useful, + *: but WITHOUT ANY WARRANTY; without even the implied warranty of + *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *: GNU General Public License for more details. + *: + *: You should have received a copy of the GNU General Public License + *: along with this program; if not, write to the Free Software + *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *:*/ + +#include "../../chat/user.h" +#include "../../chat/room.h" +/* + gcc -shared -o yc_name.so yc_name.cpp +*/ + +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 + vector<string> *params = (vector<string>*) c->elem[2]; // param array + chat* p_chat = (chat*) ((dynamic_wrap*)c->elem[3])->CHAT; + conf* p_conf = (conf*) ((dynamic_wrap*)c->elem[3])->CONF; + timr* p_timr = (timr*) ((dynamic_wrap*)c->elem[3])->TIMR; + + if ( ! params->empty() ) + { + vector<string>::iterator iter = params->begin(); + string s_gag_user(*iter); + bool b_found; + user* p_gag_user = p_chat->get_user( s_gag_user, b_found ); + + if ( b_found ) + { + string s_time = ""; + if ( p_conf->get_elem("chat.printalwaystime") == "true" ) + s_time = p_timr->get_time() + " "; + + string s_reason = ""; + for ( iter++; iter != params->end(); iter++ ) + s_reason.append( *iter + " " ); + + if ( s_reason.length() > 0 ) + s_reason = " (" + p_user->make_colors(s_reason) + ")"; + + string s_msg = s_time + "<i> " + p_user->get_colored_bold_name() + " " + p_conf->get_elem("chat.msgs.gag") + " " + + p_gag_user->get_colored_bold_name() + s_reason + "</i><br>\n"; + + + p_user->msg_post(s_msg); + if (! p_user->same_rooms(p_gag_user) ) + p_gag_user->msg_post(s_msg); + + p_gag_user->set_is_gag(true); + + } + else + { + string s_msg = "<font color=\"#" + + p_conf->get_elem("chat.html.errorcolor") + + "\"><b>" + + s_gag_user + "</b> " + + p_conf->get_elem("chat.msgs.err.notavailable") + + "</font><br>\n"; + + p_user->msg_post( &s_msg ); + } + } + + return 0; + } +} + diff --git a/src/mods/commands/yc_getroom.cpp b/src/mods/commands/yc_getroom.cpp index 4b22d81..bc0805b 100644 --- a/src/mods/commands/yc_getroom.cpp +++ b/src/mods/commands/yc_getroom.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_getroom.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_getrusage.cpp b/src/mods/commands/yc_getrusage.cpp index 56a7fbb..ba9d574 100644 --- a/src/mods/commands/yc_getrusage.cpp +++ b/src/mods/commands/yc_getrusage.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_getrusage.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_help.cpp b/src/mods/commands/yc_help.cpp index 33faf60..537e4f7 100644 --- a/src/mods/commands/yc_help.cpp +++ b/src/mods/commands/yc_help.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_help.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_invisible.cpp b/src/mods/commands/yc_invisible.cpp index 5eea510..a207827 100644 --- a/src/mods/commands/yc_invisible.cpp +++ b/src/mods/commands/yc_invisible.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_invisible.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_j.cpp b/src/mods/commands/yc_j.cpp index 15e97cc..2800764 100644 --- a/src/mods/commands/yc_j.cpp +++ b/src/mods/commands/yc_j.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_j.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_ko.cpp b/src/mods/commands/yc_ko.cpp index 40592eb..99e8613 100644 --- a/src/mods/commands/yc_ko.cpp +++ b/src/mods/commands/yc_ko.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_ko.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_m.cpp b/src/mods/commands/yc_m.cpp index fa63719..5ef0098 100644 --- a/src/mods/commands/yc_m.cpp +++ b/src/mods/commands/yc_m.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_m.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_md5.cpp b/src/mods/commands/yc_md5.cpp index 4e81ede..cede991 100644 --- a/src/mods/commands/yc_md5.cpp +++ b/src/mods/commands/yc_md5.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_md5.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_me.cpp b/src/mods/commands/yc_me.cpp index d105723..262ce11 100644 --- a/src/mods/commands/yc_me.cpp +++ b/src/mods/commands/yc_me.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_me.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_morph.cpp b/src/mods/commands/yc_morph.cpp index 22a8174..2177a39 100644 --- a/src/mods/commands/yc_morph.cpp +++ b/src/mods/commands/yc_morph.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_morph.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_msg.cpp b/src/mods/commands/yc_msg.cpp index 8889e9f..9f337c3 100644 --- a/src/mods/commands/yc_msg.cpp +++ b/src/mods/commands/yc_msg.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_msg.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_q.cpp b/src/mods/commands/yc_q.cpp index 37f472c..58422cf 100644 --- a/src/mods/commands/yc_q.cpp +++ b/src/mods/commands/yc_q.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_q.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_reload.cpp b/src/mods/commands/yc_reload.cpp index 2fe7522..ec94c5b 100644 --- a/src/mods/commands/yc_reload.cpp +++ b/src/mods/commands/yc_reload.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_reload.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_ren.cpp b/src/mods/commands/yc_ren.cpp index 90de221..658ff58 100644 --- a/src/mods/commands/yc_ren.cpp +++ b/src/mods/commands/yc_ren.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_ren.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_s.cpp b/src/mods/commands/yc_s.cpp index 42213ac..daece17 100644 --- a/src/mods/commands/yc_s.cpp +++ b/src/mods/commands/yc_s.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_s.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_set.cpp b/src/mods/commands/yc_set.cpp index 8d59908..25bb2b0 100644 --- a/src/mods/commands/yc_set.cpp +++ b/src/mods/commands/yc_set.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_set.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_template.cpp b/src/mods/commands/yc_template.cpp index a49bb69..6612e55 100644 --- a/src/mods/commands/yc_template.cpp +++ b/src/mods/commands/yc_template.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_template.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow @@ -22,28 +22,39 @@ *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *:*/ -#include <iostream> -#include "../../chat/user.h" +template<class obj_type> +tupel<obj_type>::tupel() +{ + pthread_mutex_init(&mut_tupel, NULL); +} -/* - gcc -shared -o yc_name.so yc_name.cpp -*/ +template<class obj_type> +tupel<obj_type>::tupel(obj_type t_obj) +{ + this->t_obj = t_obj; + pthread_mutex_init(&mut_tupel, NULL); +} -using namespace std; +template<class obj_type> +tupel<obj_type>::~tupel() +{ + pthread_mutex_destroy(&mut_tupel); +} extern "C" { - int extern_function(void *v_arg) - { - container *c=(container *)v_arg; - - user *p_user = (user*)c->elem[1]; // the corresponding user - vector<string> *params=(vector<string>*)c->elem[2]; // param array - - string *quitstring=new string("Text to send<br>"); - p_user->msg_post( quitstring ); + pthread_mutex_lock(&mut_tupel); + obj_type t_ret = t_obj; + pthread_mutex_unlock(&mut_tupel); + return t_ret; +} - return 0; - } +template<class obj_type> +void +tupel<obj_type>::set_elem(obj_type t_obj) +{ + pthread_mutex_lock(&mut_tupel); + this->t_obj = t_obj; + pthread_mutex_unlock(&mut_tupel); } diff --git a/src/mods/commands/yc_time.cpp b/src/mods/commands/yc_time.cpp index 31198a1..32dc8b1 100644 --- a/src/mods/commands/yc_time.cpp +++ b/src/mods/commands/yc_time.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_time.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_topic.cpp b/src/mods/commands/yc_topic.cpp index b2dfed5..d02727d 100644 --- a/src/mods/commands/yc_topic.cpp +++ b/src/mods/commands/yc_topic.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_topic.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_unban.cpp b/src/mods/commands/yc_unban.cpp new file mode 100644 index 0000000..fbe7513 --- /dev/null +++ b/src/mods/commands/yc_unban.cpp @@ -0,0 +1,73 @@ +/*:* + *: File: ./src/mods/commands/yc_unbannick.cpp + *: + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT + *: + *: Copyright (C) 2003 Paul C. Buetow, Volker Richter + *: Copyright (C) 2004 Paul C. Buetow + *: Copyright (C) 2005 EXA Digital Solutions GbR + *: + *: This program is free software; you can redistribute it and/or + *: modify it under the terms of the GNU General Public License + *: as published by the Free Software Foundation; either version 2 + *: of the License, or (at your option) any later version. + *: + *: This program is distributed in the hope that it will be useful, + *: but WITHOUT ANY WARRANTY; without even the implied warranty of + *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *: GNU General Public License for more details. + *: + *: You should have received a copy of the GNU General Public License + *: along with this program; if not, write to the Free Software + *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *:*/ + +#include "../../chat/user.h" +#include "../../chat/room.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 + vector<string> *params = (vector<string>*) c->elem[2]; // param array + chat* p_chat = (chat*) ((dynamic_wrap*)c->elem[3])->CHAT; + conf* p_conf = (conf*) ((dynamic_wrap*)c->elem[3])->CONF; + timr* p_timr = (timr*) ((dynamic_wrap*)c->elem[3])->TIMR; + + if ( ! params->empty() ) + { + vector<string>::iterator iter = params->begin(); + string s_unbannick_user(*iter); + + string s_reason = p_chat->unban_nick(s_unbannick_user); + if (s_reason.empty()) { + string s_msg = "<font color=\"#" + + p_conf->get_elem("chat.html.errorcolor") + + "\"><b>" + + s_unbannick_user + "</b> " + + p_conf->get_elem("chat.msgs.err.isnotbanned") + + "</font><br>\n"; + + p_user->msg_post( &s_msg ); + return 0; + } + + string s_time = ""; + if ( p_conf->get_elem("chat.printalwaystime") == "true" ) + s_time = p_timr->get_time() + " "; + + string s_msg = s_time + "<i> " + p_user->get_colored_bold_name() + " " + p_conf->get_elem("chat.msgs.unban") + " <b>" + + s_unbannick_user + "</b> " + s_reason + "</i><br>\n"; + + p_user->msg_post(s_msg); + } + + return 0; + } +} + diff --git a/src/mods/commands/yc_ungag.cpp b/src/mods/commands/yc_ungag.cpp new file mode 100644 index 0000000..6d8c03c --- /dev/null +++ b/src/mods/commands/yc_ungag.cpp @@ -0,0 +1,92 @@ +/*:* + *: File: ./src/mods/commands/yc_ungag.cpp + *: + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT + *: + *: Copyright (C) 2003 Paul C. Buetow, Volker Richter + *: Copyright (C) 2004 Paul C. Buetow + *: Copyright (C) 2005 EXA Digital Solutions GbR + *: + *: This program is free software; you can redistribute it and/or + *: modify it under the terms of the GNU General Public License + *: as published by the Free Software Foundation; either version 2 + *: of the License, or (at your option) any later version. + *: + *: This program is distributed in the hope that it will be useful, + *: but WITHOUT ANY WARRANTY; without even the implied warranty of + *: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + *: GNU General Public License for more details. + *: + *: You should have received a copy of the GNU General Public License + *: along with this program; if not, write to the Free Software + *: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *:*/ + +#include "../../chat/user.h" +#include "../../chat/room.h" +/* + gcc -shared -o yc_name.so yc_name.cpp +*/ + +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 + vector<string> *params = (vector<string>*) c->elem[2]; // param array + chat* p_chat = (chat*) ((dynamic_wrap*)c->elem[3])->CHAT; + conf* p_conf = (conf*) ((dynamic_wrap*)c->elem[3])->CONF; + timr* p_timr = (timr*) ((dynamic_wrap*)c->elem[3])->TIMR; + + if ( ! params->empty() ) + { + vector<string>::iterator iter = params->begin(); + string s_ungag_user(*iter); + bool b_found; + user* p_ungag_user = p_chat->get_user( s_ungag_user, b_found ); + + if ( b_found ) + { + string s_time = ""; + if ( p_conf->get_elem("chat.printalwaystime") == "true" ) + s_time = p_timr->get_time() + " "; + + string s_reason = ""; + for ( iter++; iter != params->end(); iter++ ) + s_reason.append( *iter + " " ); + + if ( s_reason.length() > 0 ) + s_reason = " (" + p_user->make_colors(s_reason) + ")"; + + string s_msg = s_time + "<i> " + p_user->get_colored_bold_name() + " " + p_conf->get_elem("chat.msgs.ungag") + " " + + p_ungag_user->get_colored_bold_name() + s_reason + "</i><br>\n"; + + + p_user->msg_post(s_msg); + if (! p_user->same_rooms(p_ungag_user) ) + p_ungag_user->msg_post(s_msg); + + p_ungag_user->set_is_gag(false); + + } + else + { + string s_msg = "<font color=\"#" + + p_conf->get_elem("chat.html.errorcolor") + + "\"><b>" + + s_ungag_user + "</b> " + + p_conf->get_elem("chat.msgs.err.notavailable") + + "</font><br>\n"; + + p_user->msg_post( &s_msg ); + } + } + + return 0; + } +} + diff --git a/src/mods/commands/yc_uptime.cpp b/src/mods/commands/yc_uptime.cpp index c86f440..f566f73 100644 --- a/src/mods/commands/yc_uptime.cpp +++ b/src/mods/commands/yc_uptime.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_uptime.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_users.cpp b/src/mods/commands/yc_users.cpp index f5cf3fc..7c9b857 100644 --- a/src/mods/commands/yc_users.cpp +++ b/src/mods/commands/yc_users.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_users.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/commands/yc_version.cpp b/src/mods/commands/yc_version.cpp index 797b6c7..6bbff31 100644 --- a/src/mods/commands/yc_version.cpp +++ b/src/mods/commands/yc_version.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/commands/yc_version.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/html/yc_admin.cpp b/src/mods/html/yc_admin.cpp index 9201021..bdf1694 100644 --- a/src/mods/html/yc_admin.cpp +++ b/src/mods/html/yc_admin.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/html/yc_admin.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/html/yc_colors.cpp b/src/mods/html/yc_colors.cpp index 4f717ad..be87942 100644 --- a/src/mods/html/yc_colors.cpp +++ b/src/mods/html/yc_colors.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/html/yc_colors.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/html/yc_help.cpp b/src/mods/html/yc_help.cpp index b7a0237..8b548e5 100644 --- a/src/mods/html/yc_help.cpp +++ b/src/mods/html/yc_help.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/html/yc_help.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/html/yc_loggedin.cpp b/src/mods/html/yc_loggedin.cpp index 6f7d020..3b14dab 100644 --- a/src/mods/html/yc_loggedin.cpp +++ b/src/mods/html/yc_loggedin.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/html/yc_loggedin.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/html/yc_options.cpp b/src/mods/html/yc_options.cpp index 71d5eef..502fdfa 100644 --- a/src/mods/html/yc_options.cpp +++ b/src/mods/html/yc_options.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/html/yc_options.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow diff --git a/src/mods/html/yc_register.cpp b/src/mods/html/yc_register.cpp index e39deaf..5ae000c 100644 --- a/src/mods/html/yc_register.cpp +++ b/src/mods/html/yc_register.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/mods/html/yc_register.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow |
