From 1a38cfdc6f2c203ceab140b1436ac9d1ed888bf6 Mon Sep 17 00:00:00 2001
From: "psyc://psyced.org/~lynX" <@>
Date: Thu, 4 Nov 2010 11:40:39 +0100
Subject: [PATCH] dialbackerrors.patch from fippo
---
CHANGESTODO | 6 +++++-
world/net/jabber/gateway.c | 17 +++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/CHANGESTODO b/CHANGESTODO
index d18c3dc..4ab6720 100644
--- a/CHANGESTODO
+++ b/CHANGESTODO
@@ -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
diff --git a/world/net/jabber/gateway.c b/world/net/jabber/gateway.c
index 3c889bb..6301afe 100644
--- a/world/net/jabber/gateway.c
+++ b/world/net/jabber/gateway.c
@@ -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(""
+ ""
+ ""
+ ""
+ "",
+ 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(""
+ ""
+ ""
+ ""
+ "",
+ 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 += "";
#endif
+ packet += "";
packet += "";
} else {
packet += ">";