cmdchar fix, let gatebot enter non-#-channels (maybe)

This commit is contained in:
psyc://psyced.org/~lynX 2010-06-21 12:41:36 +02:00
parent bc146ae8d1
commit a981a9ed64
4 changed files with 18 additions and 13 deletions

View File

@ -10,6 +10,8 @@ vim:nosmarttab:syntax=diff
________________________________________________________________________ ________________________________________________________________________
== SERIOUS!!! ========================================================== == SERIOUS!!! ==========================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- make polly use oauth - deadline: june
- remote psycers do not always show up properly via jabber client + MUC - remote psycers do not always show up properly via jabber client + MUC
- /m freenode:symlynx hey - /m freenode:symlynx hey

View File

@ -62,4 +62,7 @@ alias cvsdeath 'find . -name CVS -print -prune -exec rm -r {} \;'
alias gdifR 'git diff master..\!:1/master |& difvu -' alias gdifR 'git diff master..\!:1/master |& difvu -'
# to merge all the changes, use "gmergR <nick>" # to merge all the changes, use "gmergR <nick>"
alias gmergR 'git merge -s resolve \!:1/master' alias gmergR 'git merge -s resolve \!:1/master'
# to view the log of check-ins use this
alias glogR 'git log FETCH_HEAD'
# then you can 'git cherry-pick' specific commit hashes

View File

@ -345,7 +345,7 @@ case "privmsg":
rcpt = rcpt[0 .. <sizeof(IRCGATE_NICK)+2]; rcpt = rcpt[0 .. <sizeof(IRCGATE_NICK)+2];
# endif # endif
PT(("the rcpt is %O for %O from %O\n", rcpt, text, joe_unl)) PT(("the rcpt is %O for %O from %O\n", rcpt, text, joe_unl))
if (!rcpt || channel2place(rcpt)) pubmsg(text); if (!rcpt || !stricmp(rcpt, qChatChannel()) pubmsg(text);
else { else {
unless (text = decode(text, rcpt, !notice)) break; unless (text = decode(text, rcpt, !notice)) break;
sendmsg(rcpt, notice? "_message_private_annotate": sendmsg(rcpt, notice? "_message_private_annotate":
@ -353,7 +353,9 @@ case "privmsg":
([ "_nick" : joe_nick ]), joe_unl); ([ "_nick" : joe_nick ]), joe_unl);
} }
#else #else
unless (rcpt && (rcpt = channel2place(rcpt))) rcpt = 0; // was: unless (rcpt && (rcpt = channel2place(rcpt))) rcpt = 0;
if (rcpt && stricmp(rcpt, qChatChannel())) rcpt = 0;
unless (text = decode(text, rcpt, !notice)) break; unless (text = decode(text, rcpt, !notice)) break;
if (rcpt) { if (rcpt) {
if (from) pubmsg(text); if (from) pubmsg(text);
@ -402,8 +404,7 @@ case RPL_NAMREPLY:
break; break;
case "join": case "join":
unless (rcpt) rcpt = text; // historic syntax bug in JOIN unless (rcpt) rcpt = text; // historic syntax bug in JOIN
if (rcpt && (rcpt = channel2place(rcpt))) { if (rcpt && stricmp(rcpt, qChatChannel())) {
if (stricmp(rcpt, qChatChannel())) {
P0(("%O got autojoined into %O\n", ME, rcpt)) P0(("%O got autojoined into %O\n", ME, rcpt))
emit("PART #"+rcpt+ emit("PART #"+rcpt+
" :looks like I was autojoined here\n"); " :looks like I was autojoined here\n");
@ -420,7 +421,7 @@ case "part":
break; break;
case "001": case "001":
#ifndef SERVER #ifndef SERVER
emit("JOIN #"+qChatChannel()+" "+CHAT_CHANNEL_MODE+"\n"); emit("JOIN "+qChatChannel()+" "+CHAT_CHANNEL_MODE+"\n");
#endif #endif
#ifdef EXTRA_LOGON #ifdef EXTRA_LOGON
emit(EXTRA_LOGON+"\n"); emit(EXTRA_LOGON+"\n");
@ -729,7 +730,7 @@ tellChannel(source, mc, vars, data) {
#ifndef SERVER #ifndef SERVER
data = irctext( T(mc, ""), vars, data, source ); data = irctext( T(mc, ""), vars, data, source );
PT(("tellChannel(%O) %O\n", mc, data)) PT(("tellChannel(%O) %O\n", mc, data))
send(source, "NOTICE #"+qChatChannel()+" :"+ data +"\n"); send(source, "NOTICE "+qChatChannel()+" :"+ data +"\n");
#endif #endif
} }
@ -846,10 +847,10 @@ msg(source, mc, data, mapping vars, showingLog, target) {
if (abbrev("_message_public", mc)) { if (abbrev("_message_public", mc)) {
#ifdef SERVER #ifdef SERVER
// t = data || irctext( T(mca, 0), vars, data, source ); // t = data || irctext( T(mca, 0), vars, data, source );
// send(source, "PRIVMSG #"+qChatChannel()+" :"+ t); // send(source, "PRIVMSG "+qChatChannel()+" :"+ t);
#else #else
if (stringp(source)) vars["_nick"] = source; if (stringp(source)) vars["_nick"] = source;
send(source, "PRIVMSG #"+qChatChannel()+" :"+ send(source, "PRIVMSG "+qChatChannel()+" :"+
irctext( T(mca, 0), vars, data, source )); irctext( T(mca, 0), vars, data, source ));
#endif #endif
} }
@ -863,7 +864,7 @@ msg(source, mc, data, mapping vars, showingLog, target) {
static chanop(arg) { static chanop(arg) {
#ifndef SERVER #ifndef SERVER
log_file("IRC_BOSS", "%O chops %O on %O\n", previous_object(), arg, ME); log_file("IRC_BOSS", "%O chops %O on %O\n", previous_object(), arg, ME);
emit("MODE #"+ qChatChannel()+ " +o "+arg+"\n"); emit("MODE "+ qChatChannel()+ " +o "+arg+"\n");
#endif #endif
return 1; return 1;
} }

View File

@ -1566,10 +1566,6 @@ logon() {
0, ([ "_charset": v("charset") || SYSTEM_CHARSET ])); 0, ([ "_charset": v("charset") || SYSTEM_CHARSET ]));
#endif #endif
autojoin(); autojoin();
cmdchar = (v("commandcharacter") ||
T("_MISC_character_command", "/"))[0..0];
cmdchar = cmdchar[0];
actchar = v("actioncharacter") || T("_MISC_character_action",":"); actchar = v("actioncharacter") || T("_MISC_character_action",":");
actchar = actchar == "off" ? 0 : actchar[0]; actchar = actchar == "off" ? 0 : actchar[0];
@ -1590,6 +1586,8 @@ logon() {
::logon( query_ip_name(ME) || ::logon( query_ip_name(ME) ||
(this_interactive() && query_ip_name(this_interactive())) ); (this_interactive() && query_ip_name(this_interactive())) );
cmdchar = (v("commandcharacter") ||
T("_MISC_character_command", "/"))[0..0];
#ifndef _flag_disable_info_session #ifndef _flag_disable_info_session
// greeting is only defined after ::logon has run // greeting is only defined after ::logon has run
if (greeting) { if (greeting) {
@ -1600,6 +1598,7 @@ logon() {
([ "_command_character" : cmdchar ]) ); ([ "_command_character" : cmdchar ]) );
} }
#endif #endif
cmdchar = cmdchar[0];
} }
// net/jabber/user filters this call, so this is never executed for // net/jabber/user filters this call, so this is never executed for