mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
xmlquote status updates, minor irc fix
This commit is contained in:
parent
b3563e692c
commit
90ad3e7be4
6 changed files with 41 additions and 16 deletions
|
@ -296,12 +296,24 @@ render(string mc, string data, mapping vars, mixed source) {
|
|||
log_file("XMPP_TODO", "%O %s %s\n", ME, mc, output);
|
||||
#endif
|
||||
} else {
|
||||
// hack for a special case where status update contains <, >
|
||||
// if this kind of problem recurrs, we should quote every
|
||||
// single damn variable
|
||||
if (vars["_description_presence"])
|
||||
vars["_XML_description_presence"] =
|
||||
xmlquote(vars["_description_presence"]);
|
||||
if (stringp(data)) data = xmlquote(data);
|
||||
else if (vars["_action"])
|
||||
data = "/me " + xmlquote(vars["_action"]);
|
||||
output = psyctext(template, vars, data, source);
|
||||
if (!stringp(output) || output=="")
|
||||
return P2(("jabber:w() no output\n"));
|
||||
#if 0
|
||||
if (strstr(output, "r00t") >= 0) {
|
||||
P0(("common:render(%O, %O, %O, %O) -> %O\n", mc,
|
||||
data, vars, source, output))
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if __EFUN_DEFINED__(convert_charset) && SYSTEM_CHARSET != "UTF-8"
|
||||
if (catch(output = convert_charset(output,
|
||||
|
|
|
@ -550,6 +550,8 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||
vars["_description_presence"] =
|
||||
(node["/status"] && node["/status"][Cdata]) ?
|
||||
node["/status"][Cdata] : ""; // "Get psyced!";
|
||||
vars["_XML_description_presence"] =
|
||||
xmlquote(vars["_description_presence"]);
|
||||
vars["_INTERNAL_mood_jabber"] = "neutral";
|
||||
sendmsg(o, "_notice_presence_absent", 0,
|
||||
vars, origin);
|
||||
|
@ -693,6 +695,8 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||
vars["_description_presence"] =
|
||||
(node["/status"] && node["/status"][Cdata]) ?
|
||||
node["/status"][Cdata] : ""; // "Get psyced!";
|
||||
vars["_XML_description_presence"] =
|
||||
xmlquote(vars["_description_presence"]);
|
||||
vars["_degree_availability"] = jabber2avail[node["/show"]
|
||||
&& node["/show"][Cdata]];
|
||||
// this message is too verbose, let's put in into
|
||||
|
|
|
@ -250,11 +250,12 @@ showFriends() {
|
|||
"_INTERNAL_target_jabber" : myjid,
|
||||
"_INTERNAL_source_jabber" : mkjid(person),
|
||||
"_description_presence" : "", // TODO: get these from state
|
||||
"_XML_description_presence" : "",
|
||||
"_INTERNAL_mood_jabber" : "neutral"
|
||||
]));
|
||||
}
|
||||
if (strlen(packet)) emit(packet);
|
||||
PT(("%O jabberish showFriends: %O outputs as %O\n", ME, friends, packet))
|
||||
P2(("%O jabberish showFriends: %O outputs as %O\n", ME, friends, packet))
|
||||
}
|
||||
|
||||
logon() {
|
||||
|
@ -1212,6 +1213,7 @@ varargs string mkjid(mixed who, mixed vars, mixed ignore_nick, mixed ignore_cont
|
|||
// message rendering a la jabber
|
||||
w(string mc, string data, mapping vars, mixed source) {
|
||||
mixed t;
|
||||
|
||||
unless (mappingp(vars)) vars = ([]);
|
||||
else if (vars["_nick_verbatim"]) vars["_nick"] = vars["_nick_verbatim"];
|
||||
// ^^ this is a temporary workaround until we fix the real problem!
|
||||
|
@ -1284,7 +1286,11 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||
unless (vars["_tag_reply"]) vars["_tag_reply"] = tag;
|
||||
if (vars["_list_groups"])
|
||||
vars["_list_groups"] = IMPLODE_XML(vars["_list_groups"], "<group>");
|
||||
|
||||
#if 0
|
||||
if (stringp(data) && strstr(data, "r00t") >= 0) {
|
||||
P0(("user:w(%O, %O, %O, %O)\n", mc, data, vars, source))
|
||||
}
|
||||
#endif
|
||||
unless (interactive(ME)) {
|
||||
P1(("%O not interactive. w(%O) from %O.\n", ME, mc, source))
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue