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!!! ==========================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- make polly use oauth - deadline: june
- remote psycers do not always show up properly via jabber client + MUC
- /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 -'
# to merge all the changes, use "gmergR <nick>"
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];
# endif
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 {
unless (text = decode(text, rcpt, !notice)) break;
sendmsg(rcpt, notice? "_message_private_annotate":
@ -353,7 +353,9 @@ case "privmsg":
([ "_nick" : joe_nick ]), joe_unl);
}
#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;
if (rcpt) {
if (from) pubmsg(text);
@ -402,8 +404,7 @@ case RPL_NAMREPLY:
break;
case "join":
unless (rcpt) rcpt = text; // historic syntax bug in JOIN
if (rcpt && (rcpt = channel2place(rcpt))) {
if (stricmp(rcpt, qChatChannel())) {
if (rcpt && stricmp(rcpt, qChatChannel())) {
P0(("%O got autojoined into %O\n", ME, rcpt))
emit("PART #"+rcpt+
" :looks like I was autojoined here\n");
@ -420,7 +421,7 @@ case "part":
break;
case "001":
#ifndef SERVER
emit("JOIN #"+qChatChannel()+" "+CHAT_CHANNEL_MODE+"\n");
emit("JOIN "+qChatChannel()+" "+CHAT_CHANNEL_MODE+"\n");
#endif
#ifdef EXTRA_LOGON
emit(EXTRA_LOGON+"\n");
@ -729,7 +730,7 @@ tellChannel(source, mc, vars, data) {
#ifndef SERVER
data = irctext( T(mc, ""), vars, data, source );
PT(("tellChannel(%O) %O\n", mc, data))
send(source, "NOTICE #"+qChatChannel()+" :"+ data +"\n");
send(source, "NOTICE "+qChatChannel()+" :"+ data +"\n");
#endif
}
@ -846,10 +847,10 @@ msg(source, mc, data, mapping vars, showingLog, target) {
if (abbrev("_message_public", mc)) {
#ifdef SERVER
// t = data || irctext( T(mca, 0), vars, data, source );
// send(source, "PRIVMSG #"+qChatChannel()+" :"+ t);
// send(source, "PRIVMSG "+qChatChannel()+" :"+ t);
#else
if (stringp(source)) vars["_nick"] = source;
send(source, "PRIVMSG #"+qChatChannel()+" :"+
send(source, "PRIVMSG "+qChatChannel()+" :"+
irctext( T(mca, 0), vars, data, source ));
#endif
}
@ -863,7 +864,7 @@ msg(source, mc, data, mapping vars, showingLog, target) {
static chanop(arg) {
#ifndef SERVER
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
return 1;
}

View File

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