The Bug is easy to fix. Either one off the two patches fixes it.

handle_message_without_type.diff only fixes the problem I reported,
while  handle_all_unknown_types_as_normal.diff fixes the code, so that
it complies with the rfc section I mentioned before
Index: src/core/xmpp-protocol.c
===================================================================
RCS file: /cvs/irssi-xmpp/irssi-xmpp/src/core/xmpp-protocol.c,v
retrieving revision 1.54
diff -u -r1.54 xmpp-protocol.c
--- src/core/xmpp-protocol.c	5 Apr 2008 20:50:45 -0000	1.54
+++ src/core/xmpp-protocol.c	26 Apr 2008 06:50:24 -0000
@@ -350,6 +350,7 @@
 			}
 		}
 
+	case LM_MESSAGE_SUB_TYPE_NOT_SET:
 	case LM_MESSAGE_SUB_TYPE_HEADLINE:
 	case LM_MESSAGE_SUB_TYPE_NORMAL:
 	case LM_MESSAGE_SUB_TYPE_CHAT:
Index: src/core/xmpp-protocol.c
===================================================================
RCS file: /cvs/irssi-xmpp/irssi-xmpp/src/core/xmpp-protocol.c,v
retrieving revision 1.54
diff -u -r1.54 xmpp-protocol.c
--- src/core/xmpp-protocol.c	5 Apr 2008 20:50:45 -0000	1.54
+++ src/core/xmpp-protocol.c	26 Apr 2008 06:58:25 -0000
@@ -353,6 +353,13 @@
 	case LM_MESSAGE_SUB_TYPE_HEADLINE:
 	case LM_MESSAGE_SUB_TYPE_NORMAL:
 	case LM_MESSAGE_SUB_TYPE_CHAT:
+	/* rfc3921.txt states in 2.1.1. Types of Message:
+	 *   if an application receives a message with no 'type' attribute or the
+	 *   application does not understand the value of the 'type' attribute
+	 *   provided, it MUST consider the message to be of type "normal"
+	 * Thus default belongs here, whre LM_MESSAGE_SUB_TYPE_NORMAL is
+	 */
+	default:
 		/* XEP-0022: Message Events */
 		child = lm_message_node_get_child(msg->node, "x");
 		if (child != NULL) {
@@ -508,9 +515,6 @@
 			g_free(nick);
 		}
 
-		break;
-
-	default:
 		break;
 	}
 

Reply via email to