_source_hack becomes _INTERNAL_source_IRC

This commit is contained in:
psyc://psyced.org/~lynX 2009-03-05 11:34:22 +01:00
parent 80d9a64071
commit 87d444e1a5
5 changed files with 107 additions and 102 deletions

View File

@ -1812,8 +1812,8 @@ see also: http://about.psyc.eu/SPAM
- "known bug:" die shout()-funktionen betreiben kein vars-cloning, daher ist - "known bug:" die shout()-funktionen betreiben kein vars-cloning, daher ist
sowas möglich (das sollte aber nicht schlimm sein): sowas möglich (das sollte aber nicht schlimm sein):
place/irc caught zero source ("_notice_broadcast_garbage","Test 1.",([ place/irc caught zero source ("_notice_broadcast_garbage","Test 1.",([
"_source_hack": "c|h|a|o|s!c|h|a|o|s@ve.example.com", "_INTERNAL_source_IRC": "c|h|a|o|s!c|h|a|o|s@ve.example.com",
"_nick_me": "lethe", "_nick_me": "example",
"_nick": "c|h|a|o|s", "_nick": "c|h|a|o|s",
"_prefix": "" "_prefix": ""
])) ]))
@ -2284,8 +2284,8 @@ net/*
+ room status uses sendmsg/msg and therefore also works remotely + room status uses sendmsg/msg and therefore also works remotely
net/irc/user net/irc/user
- ::msg() was getting skipped with all sorts of complications - ::msg() was getting skipped with all sorts of complications
+ replaced [_nick]![_ident]@[_host] by [_source_hack] + replaced [_nick]![_ident]@[_host] by [_INTERNAL_source_IRC]
+ [_source_hack] contains psyc://uni with !*@* appended for remoteUNIs + [_INTERNAL_source_IRC] contains psyc://uni with !*@* appended for remoteUNIs
net/nntp net/nntp
+ fippo's gone crazy and implementing nntp based on user subscriptions + fippo's gone crazy and implementing nntp based on user subscriptions
of blog rooms. wow. of blog rooms. wow.
@ -3385,7 +3385,7 @@ irc/user
+ comma-list JOIN ignored unless _flag_allow_IRC_list_comma is set + comma-list JOIN ignored unless _flag_allow_IRC_list_comma is set
- "TOPIC :" for deleting a topic is now supported - "TOPIC :" for deleting a topic is now supported
- shut up on funny MODEs unless _flag_strict_IRC_mode is set - shut up on funny MODEs unless _flag_strict_IRC_mode is set
- minor mistake in _source_hack generation - minor mistake in _INTERNAL_source_IRC generation
- special copy+paste code to handle _list_members at entry discontinued - special copy+paste code to handle _list_members at entry discontinued
- changed the text in RPL_ISUPPORT to literally what it says in the - changed the text in RPL_ISUPPORT to literally what it says in the
RFC. messages wheren't supposed to be used for detecting IRC semantics RFC. messages wheren't supposed to be used for detecting IRC semantics

View File

@ -1723,10 +1723,10 @@ _warning_usage_auto
|Syntax: /[_nick] <beschreibung> |Syntax: /[_nick] <beschreibung>
_warning_usage_tell _warning_usage_tell
|Syntax: /tell <Spitzname> <Nachricht> |Syntax: /tell <Person> <Nachricht>
_warning_usage_notify _warning_usage_notify
|Syntax: /notify <Spitzname> [ i(mmediate),d(elayed),D(elayedMore) ] |Syntax: /notify <Person> [ i(mmediate),d(elayed),D(elayedMore) ]
_warning_usage_acquaintance _warning_usage_acquaintance
|Syntax: /ignore oder /display <person> |Syntax: /ignore oder /display <person>
@ -1772,13 +1772,13 @@ _warning_usage_invite
|Syntax: /invite <Person> |Syntax: /invite <Person>
_warning_usage_query _warning_usage_query
|Syntax: /talk <Spitzname> und /talk zum Beenden des Zwiegesprächs. |Syntax: /talk <Person> und /talk zum Beenden des Zwiegesprächs.
_warning_usage_friend _warning_usage_friend
|Syntax: /friend <Spitzname> oder /unfriend <Spitzname> |Syntax: /friend <Person> oder /unfriend <Person>
_warning_usage_authenticate _warning_usage_authenticate
|Syntax: /auth(enticate) <Spitzname|psycUNI> |Syntax: /auth(enticate) <Person>
_warning_usage_logging _warning_usage_logging
|Syntax: /logging (on|off) |Syntax: /logging (on|off)

View File

@ -2,7 +2,7 @@
## Check utf-8: Praise Atatürk! ## Check utf-8: Praise Atatürk!
_status_AREYOUNUTS _status_AREYOUNUTS
|:[_source_hack] NOTICE [_nick_me] :[_data] |:[_INTERNAL_source_IRC] NOTICE [_nick_me] :[_data]
_MISC_character_command _MISC_character_command
|+ |+
@ -14,28 +14,28 @@ _echo_invitation
|#341 [_nick_me] [_nick_target] #[_nick_place] |#341 [_nick_me] [_nick_target] #[_nick_place]
_echo_place_enter _echo_place_enter
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_echo_place_enter_automatic _echo_place_enter_automatic
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_echo_place_enter_subscribe _echo_place_enter_subscribe
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_echo_place_enter_login _echo_place_enter_login
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_echo_place_enter_home _echo_place_enter_home
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_echo_place_enter_join _echo_place_enter_join
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_echo_place_enter_follow _echo_place_enter_follow
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_echo_place_enter_automatic_subscription _echo_place_enter_automatic_subscription
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_info_commands _info_commands
|## gaim comes up with a useless popup instead of |## gaim comes up with a useless popup instead of
@ -90,7 +90,7 @@ _list_places_end
_echo_alias_added_NICEBUTCANTWORK _echo_alias_added_NICEBUTCANTWORK
|:[_alias] NICK {_VAR_server_uniform}~[_alias] |:[_alias] NICK {_VAR_server_uniform}~[_alias]
|:{_VAR_server_uniform}~[_address] NICK [_address] |:{_VAR_server_uniform}~[_address] NICK [_address]
|## :[_source_hack] NOTICE :{_VAR_method} |## :[_INTERNAL_source_IRC] NOTICE :{_VAR_method}
|NOTICE :{_VAR_method} |NOTICE :{_VAR_method}
_echo_end_places _echo_end_places
@ -112,13 +112,13 @@ _echo_start_places_entered
|#321 Channel :Users Topic |#321 Channel :Users Topic
_request_legacy_CTCP _request_legacy_CTCP
|:[_source_hack] PRIVMSG [_nick_me] :%[_type] [_value]% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%[_type] [_value]%
_status_legacy_CTCP _status_legacy_CTCP
|:[_source_hack] NOTICE [_nick_me] :%[_type] [_value]% |:[_INTERNAL_source_IRC] NOTICE [_nick_me] :%[_type] [_value]%
_request_version _request_version
|:[_source_hack] PRIVMSG [_nick_me] :%VERSION% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%VERSION%
_error_unknown_name_user _error_unknown_name_user
|#401 [_nick_me] [_nick_target] :{_error_unknown_name_user} |#401 [_nick_me] [_nick_target] :{_error_unknown_name_user}
@ -141,65 +141,65 @@ _query_password
|Please provide your password (Set it as the server password, or try /quote pass «your-password» or a syntax like /server {_VAR_server} «ircport» «your-password») |Please provide your password (Set it as the server password, or try /quote pass «your-password» or a syntax like /server {_VAR_server} «ircport» «your-password»)
_message_private _message_private
|:[_source_hack] PRIVMSG [_nick_me] :[_data] |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :[_data]
_message_public _message_public
|:[_source_hack] PRIVMSG #[_nick_place] :[_data] |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :[_data]
_message_echo_private _message_echo_private
|## let's see how clients deal with messages to a remote target echoed back |## let's see how clients deal with messages to a remote target echoed back
|## it will probably not look good, but the clients need to fix that really |## it will probably not look good, but the clients need to fix that really
|:[_source_hack] PRIVMSG [_nick_target] :[_data] |:[_INTERNAL_source_IRC] PRIVMSG [_nick_target] :[_data]
|## oh, ircII is pretty cool about this. it shows: |## oh, ircII is pretty cool about this. it shows:
|## -source:target- message |## -source:target- message
_message_echo_private_NOT _message_echo_private_NOT
|## without this format, "You tell.. " is generated |## without this format, "You tell.. " is generated
|## this is how BNC sends it instead: |## this is how BNC sends it instead:
|:[_source_hack] PRIVMSG [_nick_me] :<- <[_nick_me]> [_data] |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :<- <[_nick_me]> [_data]
|## which is just like _message_private with an extra that isn't tamper-proof |## which is just like _message_private with an extra that isn't tamper-proof
_message_echo_public _message_echo_public
|:[_source_hack] PRIVMSG #[_nick_place] :[_data] |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :[_data]
_message_echo_public_action _message_echo_public_action
|:[_source_hack] PRIVMSG #[_nick_place] :%ACTION [_prefix][_action].% |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :%ACTION [_prefix][_action].%
_message_echo_public_ask _message_echo_public_ask
|:[_source_hack] PRIVMSG #[_nick_place] :%ACTION [_prefix]{_TEXT_action_asks}: [_data]% |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :%ACTION [_prefix]{_TEXT_action_asks}: [_data]%
_message_echo_public_text_action _message_echo_public_text_action
|:[_source_hack] PRIVMSG #[_nick_place] :%ACTION [_prefix][_action]: [_data]% |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :%ACTION [_prefix][_action]: [_data]%
_message_public_action _message_public_action
|:[_source_hack] PRIVMSG #[_nick_place] :%ACTION [_prefix][_action].% |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :%ACTION [_prefix][_action].%
_message_public_question _message_public_question
|:[_source_hack] PRIVMSG #[_nick_place] :%ACTION [_prefix]{_TEXT_action_asks}: [_data]% |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :%ACTION [_prefix]{_TEXT_action_asks}: [_data]%
_message_public_ask _message_public_ask
|:[_source_hack] PRIVMSG #[_nick_place] :%ACTION [_prefix]{_TEXT_action_asks}: [_data]% |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :%ACTION [_prefix]{_TEXT_action_asks}: [_data]%
_message_public_text_action _message_public_text_action
|:[_source_hack] PRIVMSG #[_nick_place] :%ACTION [_prefix][_action]: [_data]% |:[_INTERNAL_source_IRC] PRIVMSG #[_nick_place] :%ACTION [_prefix][_action]: [_data]%
_message_private_annotate _message_private_annotate
|:[_source_hack] NOTICE [_nick_me] :[_data] |:[_INTERNAL_source_IRC] NOTICE [_nick_me] :[_data]
_message_private_action _message_private_action
|:[_source_hack] PRIVMSG [_nick_me] :%ACTION [_action].% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%ACTION [_action].%
_message_private_question _message_private_question
|:[_source_hack] PRIVMSG [_nick_me] :%ACTION {_TEXT_action_asks}: [_data]% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%ACTION {_TEXT_action_asks}: [_data]%
_message_private_ask _message_private_ask
|:[_source_hack] PRIVMSG [_nick_me] :%ACTION {_TEXT_action_asks}: [_data]% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%ACTION {_TEXT_action_asks}: [_data]%
_message_private_text_action _message_private_text_action
|:[_source_hack] PRIVMSG [_nick_me] :%ACTION [_action]: [_data]% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%ACTION [_action]: [_data]%
_message_private_action_action _message_private_action_action
|:[_source_hack] PRIVMSG [_nick_me] :%ACTION [_action].% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%ACTION [_action].%
_notice_switch_identity _notice_switch_identity
|:[_nick_me] NICK [_nick_next] |:[_nick_me] NICK [_nick_next]
@ -208,53 +208,53 @@ _notice_login
|## shut up |## shut up
_notice_invitation _notice_invitation
|:[_source_hack] INVITE [_nick_me] :#[_nick_place] |:[_INTERNAL_source_IRC] INVITE [_nick_me] :#[_nick_place]
_notice_typing_inactive _notice_typing_inactive
|:[_source_hack] PRIVMSG [_nick_me] :%TYPING INACTIVE% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%TYPING INACTIVE%
_notice_typing_paused _notice_typing_paused
|:[_source_hack] PRIVMSG [_nick_me] :%TYPING PAUSED% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%TYPING PAUSED%
_notice_typing_composing _notice_typing_composing
|:[_source_hack] PRIVMSG [_nick_me] :%TYPING COMPOSING% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%TYPING COMPOSING%
_notice_typing_active _notice_typing_active
|:[_source_hack] PRIVMSG [_nick_me] :%TYPING ACTIVE% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%TYPING ACTIVE%
_notice_typing_gone _notice_typing_gone
|:[_source_hack] PRIVMSG [_nick_me] :%TYPING GONE% |:[_INTERNAL_source_IRC] PRIVMSG [_nick_me] :%TYPING GONE%
_notice_place_AREYOUNUTS _notice_place_AREYOUNUTS
|:{_VAR_server} NOTICE #[_nick_place] :[_data] |:{_VAR_server} NOTICE #[_nick_place] :[_data]
_notice_place_enter _notice_place_enter
|## es wird nur diese JOIN datei verwendet.. die anderen können alle in den müll |## es wird nur diese JOIN datei verwendet.. die anderen können alle in den müll
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_notice_place_enter_automatic _notice_place_enter_automatic
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_notice_place_enter_subscribe _notice_place_enter_subscribe
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_notice_place_enter_login _notice_place_enter_login
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_notice_place_enter_home _notice_place_enter_home
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_notice_place_enter_join _notice_place_enter_join
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_notice_place_enter_follow _notice_place_enter_follow
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_notice_place_enter_automatic_subscription _notice_place_enter_automatic_subscription
|:[_source_hack] JOIN :#[_nick_place] |:[_INTERNAL_source_IRC] JOIN :#[_nick_place]
_echo_place_leave _echo_place_leave
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_echo_place_leave_logout _echo_place_leave_logout
|## Why is this blank? Current w() code ignores this however. |## Why is this blank? Current w() code ignores this however.
@ -262,59 +262,59 @@ _echo_place_leave_logout
_notice_place_leave _notice_place_leave
|## user messages embedded in state changes are bad protocol design |## user messages embedded in state changes are bad protocol design
|## we use the space for system text |## we use the space for system text
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_automatic _notice_place_leave_automatic
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_subscribe _notice_place_leave_subscribe
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_netburp _notice_place_leave_netburp
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_home _notice_place_leave_home
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_disconnect _notice_place_leave_disconnect
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_netburp _notice_place_leave_netburp
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_follow _notice_place_leave_follow
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_logout _notice_place_leave_logout
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_automatic_subscription _notice_place_leave_automatic_subscription
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_leave_invalid _notice_place_leave_invalid
|:[_source_hack] PART #[_nick_place] :{_VAR_method} |:[_INTERNAL_source_IRC] PART #[_nick_place] :{_VAR_method}
_notice_place_topic _notice_place_topic
|:[_source_hack] TOPIC #[_nick_place] :[_topic] |:[_INTERNAL_source_IRC] TOPIC #[_nick_place] :[_topic]
_notice_place_topic_official _notice_place_topic_official
|#332 [_nick_me] #[_nick_place] :[_topic] |#332 [_nick_me] #[_nick_place] :[_topic]
_echo_ping _echo_ping
|:[_source_hack] NOTICE [_nick_me] :%PING [_time_ping]% |:[_INTERNAL_source_IRC] NOTICE [_nick_me] :%PING [_time_ping]%
_failure_unsupported_ping _failure_unsupported_ping
|## yes, this is a pong also... |## yes, this is a pong also...
|:[_source_hack] NOTICE [_nick_me] :%PING [_time_ping]% |:[_INTERNAL_source_IRC] NOTICE [_nick_me] :%PING [_time_ping]%
_info_server_version _info_server_version
|:[_host_server] 351 [_nick_me] [_version].[_degree_debug] [_host_server] :[_version_server] using [_version_driver] available from [_page_server_software] |:[_host_server] 351 [_nick_me] [_version].[_degree_debug] [_host_server] :[_version_server] using [_version_driver] available from [_page_server_software]
_status_version _status_version
|:[_source_hack] NOTICE [_nick_me] :%VERSION [_version_description] ([_version])% |:[_INTERNAL_source_IRC] NOTICE [_nick_me] :%VERSION [_version_description] ([_version])%
_status_version_agent _status_version_agent
|:[_source_hack] NOTICE [_nick_me] :%VERSION [_version_description] ([_version])% |:[_INTERNAL_source_IRC] NOTICE [_nick_me] :%VERSION [_version_description] ([_version])%
_list_friends_channel _list_friends_channel
|#353 [_nick_me] = & :[_friends] |#353 [_nick_me] = & :[_friends]

View File

@ -330,7 +330,7 @@ case "privmsg":
// joe_nick +" :You're not registered yet.\n"; // joe_nick +" :You're not registered yet.\n";
render("_error_necessary_registration", render("_error_necessary_registration",
"Sorry, you cannot use this without prior registration.", ([ "Sorry, you cannot use this without prior registration.", ([
"_source_hack": IRCGATE_NICK, "_INTERNAL_source_IRC": IRCGATE_NICK,
"_nick_me" : joe_nick, "_nick_me" : joe_nick,
])); ]));
return 1; return 1;
@ -821,7 +821,7 @@ msg(source, mc, data, mapping vars, showingLog, target) {
} }
#else #else
// TODO: remove 'pm' logic? // TODO: remove 'pm' logic?
vars["_source_hack"] = source; vars["_INTERNAL_source_IRC"] = source;
vars["_nick_me"] = ni; vars["_nick_me"] = ni;
//send(source, psyctext(t, vars, data, source)); //send(source, psyctext(t, vars, data, source));
render(mca, data, vars, source); render(mca, data, vars, source);

View File

@ -241,7 +241,7 @@ w(string mc, string data, mapping vars, mixed source) {
// der raum uns ne kopie gibt.. ist auch gut so, denn der irc code // der raum uns ne kopie gibt.. ist auch gut so, denn der irc code
// versaut total die history der räume! einmal ein ircer // versaut total die history der räume! einmal ein ircer
// drin gehabt und aus vars["_time_place"] sind _prefix'e geworden // drin gehabt und aus vars["_time_place"] sind _prefix'e geworden
// und _source_hack's sind im raum gespeichert und mehr so unsinn. // und _INTERNAL_source_IRC's sind im raum gespeichert und mehr so unsinn.
if (mappingp(vars)) vars = copy(vars); if (mappingp(vars)) vars = copy(vars);
else vars = ([]); else vars = ([]);
// hmm.. wie die _time_place's aus der room history rausfallen // hmm.. wie die _time_place's aus der room history rausfallen
@ -302,7 +302,8 @@ w(string mc, string data, mapping vars, mixed source) {
return ::wAction(mc, data, vars return ::wAction(mc, data, vars
+ ([ "_action" : T("_TEXT_action_says", 0) ]), + ([ "_action" : T("_TEXT_action_says", 0) ]),
source, "", vars["_nick"]); source, "", vars["_nick"]);
#ifdef OLD_LOCAL_NICK_PLAIN_TEXTDB_HACK //{{{ #if 1 //def USE_THE_NICK
# ifdef OLD_LOCAL_NICK_PLAIN_TEXTDB_HACK //{{{
else if (vars["_nick_local"]) { // less work else if (vars["_nick_local"]) { // less work
if (mc == "_message_echo_public_action" if (mc == "_message_echo_public_action"
&& (t = vars["_INTERNAL_nick_plain"])) { && (t = vars["_INTERNAL_nick_plain"])) {
@ -318,11 +319,12 @@ w(string mc, string data, mapping vars, mixed source) {
sTextPath(0, v("language"), v("scheme")); sTextPath(0, v("language"), v("scheme"));
} }
} }
#else //}}} # else //}}}
else if (vars["_nick_local"] && else if (vars["_nick_local"] &&
vars["_nick_local"] == vars["_nick"]) vars["_nick_local"] == vars["_nick"])
vars["_nick"] = vars["_INTERNAL_nick_plain"] || vars["_nick_verbatim"]; vars["_nick"] = vars["_INTERNAL_nick_plain"] || vars["_nick_verbatim"];
#endif # endif
#endif // USE_THE_NICK
// if (vars["_nick_local"]) mc += "_masquerade"; // more work // if (vars["_nick_local"]) mc += "_masquerade"; // more work
di = printStyle(mc); // display infos di = printStyle(mc); // display infos
@ -372,32 +374,32 @@ w(string mc, string data, mapping vars, mixed source) {
#ifdef GHOST //{{{ #ifdef GHOST //{{{
// in S2S mode we are not supposed to deliver nick!user@host // in S2S mode we are not supposed to deliver nick!user@host
// thus we use plain nicks or plain uniforms // thus we use plain nicks or plain uniforms
vars["_source_hack"] = vars["_INTERNAL_nick_plain"] || vars["_nick"]; vars["_INTERNAL_source_IRC"] = vars["_INTERNAL_nick_plain"] || vars["_nick"];
#else //}}} #else //}}}
# if 0 // OLD // according to elmex "should never happen" happened... # if 0 // OLD // according to elmex "should never happen" happened...
if (vars["_nick"]) { if (vars["_nick"]) {
vars["_source_hack"] = vars["_INTERNAL_source_IRC"] =
(vars["_INTERNAL_nick_plain"] || vars["_nick"]) (vars["_INTERNAL_nick_plain"] || vars["_nick"])
+ "!"+ (vars["_nick_long"] || vars["_INTERNAL_nick_plain"] + "!"+ (vars["_nick_long"] || vars["_INTERNAL_nick_plain"]
|| vars["_nick"]) || vars["_nick"])
+"@" SERVER_HOST; +"@" SERVER_HOST;
} else // should never happen } else // should never happen
vars["_source_hack"] = to_string(source); vars["_INTERNAL_source_IRC"] = to_string(source);
# else // EXPERIMENTAL # else // EXPERIMENTAL
nick2 = vars["_INTERNAL_nick_plain"] || vars["_nick"]; nick2 = vars["_INTERNAL_nick_plain"] || vars["_nick"];
vars["_source_hack"] = nick2 ? nick2 vars["_INTERNAL_source_IRC"] = nick2 ? nick2
+"!"+ (vars["_nick_long"] || vars["_INTERNAL_nick_plain"] +"!"+ (vars["_nick_long"] || vars["_INTERNAL_nick_plain"]
|| vars["_nick"]) +"@" SERVER_HOST || vars["_nick"]) +"@" SERVER_HOST
: to_string(source); // should never happen : to_string(source); // should never happen
# endif # endif
} else if (abbrev("_echo_place_enter", mc)) { } else if (abbrev("_echo_place_enter", mc)) {
vars["_source_hack"] = MYNICK + "!" + MYNICK + "@" SERVER_HOST; vars["_INTERNAL_source_IRC"] = MYNICK + "!" + MYNICK + "@" SERVER_HOST;
#endif #endif
} else { } else {
#ifdef GHOST //{{{ #ifdef GHOST //{{{
// in S2S mode we are not supposed to deliver nick!user@host // in S2S mode we are not supposed to deliver nick!user@host
// thus we use plain nicks or plain uniforms // thus we use plain nicks or plain uniforms
vars["_source_hack"] = source; vars["_INTERNAL_source_IRC"] = source;
#else //}}} #else //}}}
u = parse_uniform(source); u = parse_uniform(source);
unless (u) { unless (u) {
@ -412,7 +414,7 @@ w(string mc, string data, mapping vars, mixed source) {
# ifdef ALIASES # ifdef ALIASES
if (raliases[source]) { if (raliases[source]) {
nick2 = raliases[source]; nick2 = raliases[source];
vars["_source_hack"] = nick2 +"!"+ vars["_INTERNAL_source_IRC"] = nick2 +"!"+
u[UNick]? u[UNick] +"@"+ u[UHost] u[UNick]? u[UNick] +"@"+ u[UHost]
: (vars["_nick_long"] : (vars["_nick_long"]
|| vars["_INTERNAL_nick_plain"] || vars["_INTERNAL_nick_plain"]
@ -422,22 +424,25 @@ w(string mc, string data, mapping vars, mixed source) {
unless (nick2) { unless (nick2) {
# endif # endif
// should all of this go into our own copy of uni2nick() ?
// or should we keep protocol source hacks separate from
// people nicks in message templates?
switch (u[UScheme]) { switch (u[UScheme]) {
case "psyc": case "psyc":
if (u[UUser] || (u[UResource] && strlen(u[UResource]) if (u[UUser] || (u[UResource] && strlen(u[UResource])
&& u[UResource][0] == '~')) { && u[UResource][0] == '~')) {
string tmp = u[UNick]; string tmp = u[UNick];
vars["_source_hack"] = u[UScheme] + "://" vars["_INTERNAL_source_IRC"] = u[UScheme] + "://"
+ u[UHostPort] +"/~"+ tmp +"!"+ tmp +"@" + u[UHostPort] +"/~"+ tmp +"!"+ tmp +"@"
+ u[UHostPort]; + u[UHostPort];
P4(("w:psyc _source_hack %O\n", vars["_source_hack"])) P4(("w:psyc _INTERNAL_source_IRC %O\n", vars["_INTERNAL_source_IRC"]))
} else { } else {
vars["_source_hack"] = uniform2irc(source) vars["_INTERNAL_source_IRC"] = uniform2irc(source)
+"!*@"+ (u[UHostPort] || "host.undefined"); +"!*@"+ (u[UHostPort] || "host.undefined");
// '*' nicer than 'undefined' and never a nick // '*' nicer than 'undefined' and never a nick
// this happens a lot more often then we thought :( // this happens a lot more often then we thought :(
// like for _request_version from server_unl // like for _request_version from server_unl
D1( unless(u[UHostPort]) PP(("irc/user %O source %O results in %O for %O\n", ME, source, vars["_source_hack"], mc)); ) D1( unless(u[UHostPort]) PP(("irc/user %O source %O results in %O for %O\n", ME, source, vars["_INTERNAL_source_IRC"], mc)); )
} }
break; break;
case "jabber": case "jabber":
@ -453,22 +458,22 @@ w(string mc, string data, mapping vars, mixed source) {
P3(("changing source from %O to %O\n", source, vars["_location"])) P3(("changing source from %O to %O\n", source, vars["_location"]))
source = vars["_location"]; source = vars["_location"];
} }
vars["_source_hack"] = uniform2irc(source) vars["_INTERNAL_source_IRC"] = uniform2irc(source)
+ "!" + u[UUserAtHost]; + "!" + u[UUserAtHost];
#ifdef JABBER_PATH // MUC support.. #ifdef JABBER_PATH // MUC support..
// unfortunately, net/entity has rendered _nick unusable // unfortunately, net/entity has rendered _nick unusable
if (vars["_nick_place"] && vars["_INTERNAL_source_resource"] && member(vars["_INTERNAL_source_resource"], ' ') != -1){ if (vars["_nick_place"] && vars["_INTERNAL_source_resource"] && member(vars["_INTERNAL_source_resource"], ' ') != -1){
// xmpp: is here in cleartext.. TODO maybe? // xmpp: is here in cleartext.. TODO maybe?
vars["_source_hack"] = "xmpp:"+ vars["_INTERNAL_source_IRC"] = "xmpp:"+
uniform2irc(u[UUserAtHost]); uniform2irc(u[UUserAtHost]);
t = replace(vars["_INTERNAL_source_resource"], " ", "%20"); t = replace(vars["_INTERNAL_source_resource"], " ", "%20");
vars["_source_hack"] += "/" + t + "!" + u[UUserAtHost]; vars["_INTERNAL_source_IRC"] += "/" + t + "!" + u[UUserAtHost];
PT(("irc/user: XMPP source hack %O for %O\n", vars["_source_hack"], ME)) PT(("irc/user: XMPP source hack %O for %O\n", vars["_INTERNAL_source_IRC"], ME))
} }
#endif #endif
break; break;
default: default:
vars["_source_hack"] = source + "!*@*"; vars["_INTERNAL_source_IRC"] = source + "!*@*";
} }
# ifdef ALIASES # ifdef ALIASES
} }
@ -482,7 +487,7 @@ w(string mc, string data, mapping vars, mixed source) {
int l; int l;
string output; string output;
output =":"+ vars["_source_hack"] +" NOTICE "+ MYNICK +" :"; output =":"+ vars["_INTERNAL_source_IRC"] +" NOTICE "+ MYNICK +" :";
l = strlen(output); l = strlen(output);
output += "#PRESENCE "+ t +" "+ vars["_degree_mood"] output += "#PRESENCE "+ t +" "+ vars["_degree_mood"]
+" :"+ vars["_description_presence"] +"#\n"; +" :"+ vars["_description_presence"] +"#\n";
@ -497,20 +502,20 @@ w(string mc, string data, mapping vars, mixed source) {
if (old <= AVAILABILITY_VACATION) { if (old <= AVAILABILITY_VACATION) {
if (t >= AVAILABILITY_NEARBY) if (t >= AVAILABILITY_NEARBY)
emit(":"+ vars["_source_hack"] +" JOIN :&HERE\n"); emit(":"+ vars["_INTERNAL_source_IRC"] +" JOIN :&HERE\n");
else if (t >= AVAILABILITY_AWAY) else if (t >= AVAILABILITY_AWAY)
emit(":"+ vars["_source_hack"] +" JOIN :&AWAY\n"); emit(":"+ vars["_INTERNAL_source_IRC"] +" JOIN :&AWAY\n");
} else if (old < AVAILABILITY_NEARBY) { } else if (old < AVAILABILITY_NEARBY) {
if (t >= AVAILABILITY_NEARBY) { if (t >= AVAILABILITY_NEARBY) {
emit(":"+ vars["_source_hack"] +" PART :&AWAY\n"); emit(":"+ vars["_INTERNAL_source_IRC"] +" PART :&AWAY\n");
emit(":"+ vars["_source_hack"] +" JOIN :&HERE\n"); emit(":"+ vars["_INTERNAL_source_IRC"] +" JOIN :&HERE\n");
} else if (t < AVAILABILITY_AWAY) } else if (t < AVAILABILITY_AWAY)
emit(":"+ vars["_source_hack"] +" PART :&AWAY\n"); emit(":"+ vars["_INTERNAL_source_IRC"] +" PART :&AWAY\n");
} else { } else {
if (t < AVAILABILITY_NEARBY) if (t < AVAILABILITY_NEARBY)
emit(":"+ vars["_source_hack"] +" PART :&HERE\n"); emit(":"+ vars["_INTERNAL_source_IRC"] +" PART :&HERE\n");
if (t >= AVAILABILITY_AWAY) if (t >= AVAILABILITY_AWAY)
emit(":"+ vars["_source_hack"] +" JOIN :&AWAY\n"); emit(":"+ vars["_INTERNAL_source_IRC"] +" JOIN :&AWAY\n");
} }
# else # else
// ... MODE #whateverTesting +v xni3 // ... MODE #whateverTesting +v xni3