diff options
Diffstat (limited to 'protocols/jabber/message.c')
-rw-r--r-- | protocols/jabber/message.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/jabber/message.c b/protocols/jabber/message.c index a226a225..ce5017fb 100644 --- a/protocols/jabber/message.c +++ b/protocols/jabber/message.c @@ -54,11 +54,12 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data ) char *ns = xt_find_attr( c, "xmlns" ), *room; struct xt_node *inv, *reason; - if( strcmp( ns, XMLNS_MUC_USER ) == 0 && + if( ns && strcmp( ns, XMLNS_MUC_USER ) == 0 && ( inv = xt_find_node( c->children, "invite" ) ) ) { room = from; - from = xt_find_attr( inv, "from" ) ? : from; + if( ( from = xt_find_attr( inv, "from" ) ) == NULL ) + from = room; g_string_append_printf( fullmsg, "<< \002BitlBee\002 - Invitation to chatroom %s >>\n", room ); if( ( reason = xt_find_node( inv->children, "reason" ) ) && reason->text_len > 0 ) @@ -71,7 +72,7 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data ) if( bud ) { bud->last_msg = time( NULL ); - from = bud->ext_jid ? : bud->bare_jid; + from = bud->ext_jid ? bud->ext_jid : bud->bare_jid; } else *s = 0; /* We need to generate a bare JID now. */ @@ -79,8 +80,8 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data ) if( type && strcmp( type, "headline" ) == 0 ) { - c = xt_find_node( node->children, "subject" ); - g_string_append_printf( fullmsg, "Headline: %s\n", c && c->text_len > 0 ? c->text : "" ); + if( ( c = xt_find_node( node->children, "subject" ) ) && c->text_len > 0 ) + g_string_append_printf( fullmsg, "Headline: %s\n", c->text ); /* <x xmlns="jabber:x:oob"><url>http://....</url></x> can contain a URL, it seems. */ for( c = node->children; c; c = c->next ) |