dialbackerrors.patch from fippo

This commit is contained in:
psyc://psyced.org/~lynX 2010-11-04 11:40:39 +01:00
parent cfbd6c8827
commit 1a38cfdc6f
2 changed files with 22 additions and 1 deletions

View File

@ -10,7 +10,11 @@ vim:nosmarttab:syntax=diff
________________________________________________________________________
== SERIOUS!!! ==========================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- make polly use oauth - deadline: june
- check in user:input() if data is in utf8 (using RE_UTF8) in order to produce
proper error messages before it is processed further and may end up in
net/jabber's emit() where it is dropped silently (see CHARS_XMPP.log)
- make polly use oauth
- remote psycers do not always show up properly via jabber client + MUC

View File

@ -273,8 +273,16 @@ jabberMsg(XMLNode node) {
monitor_report("_error_unknown_host",
sprintf("%O sent us a dialback packet believing we would be %O",
source, target));
emit(sprintf("<db:result from='%s' to='%s' type='error'>"
"<error type='cancel'>"
"<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"
"</error>"
"</db:result>",
target, source));
/* no more...
STREAM_ERROR("host-unknown", "")
remove_interactive(ME);
*/
return;
}
// dialback without dial-back - if the certificate is valid and the sender
@ -342,8 +350,16 @@ jabberMsg(XMLNode node) {
*/
// same as above...
unless (is_localhost(lower_case(target))) {
emit(sprintf("<db:verify from='%s' to='%s' id='%s' type='error'>"
"<error type='cancel'>"
"<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"
"</error>"
"</db:result>",
target, source, node["@id"]));
/*
STREAM_ERROR("host-unknown", "")
QUIT
*/
}
valid = node[Cdata] == DIALBACK_KEY(node["@id"], source,
target);
@ -546,6 +562,7 @@ open_stream(XMLNode node) {
#ifdef XMPP_BIDI
packet += "<bidi xmlns='urn:xmpp:features:bidi'/>";
#endif
packet += "<dialback xmlns='urn:xmpp:features:dialback'><errors/></dialback>";
packet += "</stream:features>";
} else {
packet += ">";