aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/iq.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2009-12-13 14:48:56 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2009-12-13 14:48:56 +0000
commit1c3008ac0b2b29f7e14ec9b874af3277c511c7a4 (patch)
tree06bbcb3f3dfc999ff44ee4c41b86f590fc1f6aef /protocols/jabber/iq.c
parent2288705af462b4aca2d56f228bff269eab8d8b5f (diff)
No functional changes, just some style "fixes". Although I admit I'm
somewhat growing out of my own coding style, I do try to keep things consistent at least within files. Comments are now in reviewboard: http://code.bitlbee.org/rb/r/13/
Diffstat (limited to 'protocols/jabber/iq.c')
-rw-r--r--protocols/jabber/iq.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c
index f17a7bb5..e0658a9e 100644
--- a/protocols/jabber/iq.c
+++ b/protocols/jabber/iq.c
@@ -98,9 +98,9 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )
XMLNS_CHATSTATES,
XMLNS_MUC,
XMLNS_PING,
- XMLNS_SI,
- XMLNS_BYTESTREAMS,
- XMLNS_FILETRANSFER,
+ XMLNS_SI,
+ XMLNS_BYTESTREAMS,
+ XMLNS_FILETRANSFER,
NULL };
const char **f;
@@ -126,16 +126,18 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )
}
else if( strcmp( type, "set" ) == 0 )
{
- if( ( c = xt_find_node( node->children, "si" ) ) &&
- ( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_SI ) == 0 ) )
+ if( ( c = xt_find_node( node->children, "si" ) ) &&
+ ( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_SI ) == 0 ) )
{
return jabber_si_handle_request( ic, node, c );
- } else if( !( c = xt_find_node( node->children, "query" ) ) ||
- !( s = xt_find_attr( c, "xmlns" ) ) )
+ }
+ else if( !( c = xt_find_node( node->children, "query" ) ) ||
+ !( s = xt_find_attr( c, "xmlns" ) ) )
{
imcb_log( ic, "Warning: Received incomplete IQ-%s packet", type );
return XT_HANDLED;
- } else if( strcmp( s, XMLNS_ROSTER ) == 0 )
+ }
+ else if( strcmp( s, XMLNS_ROSTER ) == 0 )
{
/* This is a roster push. XMPP servers send this when someone
was added to (or removed from) the buddy list. AFAIK they're
@@ -159,11 +161,13 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )
reply = jabber_make_error_packet( node, "not-allowed", "cancel", NULL );
pack = 0;
}
- } else if( strcmp( s, XMLNS_BYTESTREAMS ) == 0 )
+ }
+ else if( strcmp( s, XMLNS_BYTESTREAMS ) == 0 )
{
- /* Bytestream Request (stage 2 of file transfer) */
+ /* Bytestream Request (stage 2 of file transfer) */
return jabber_bs_recv_request( ic, node, c );
- } else
+ }
+ else
{
xt_free_node( reply );
reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel", NULL );
@@ -654,9 +658,10 @@ xt_status jabber_iq_parse_features( struct im_connection *ic, struct xt_node *no
}
c = c->children;
- while( ( c = xt_find_node( c, "feature" ) ) ) {
+ while( ( c = xt_find_node( c, "feature" ) ) )
+ {
feature = xt_find_attr( c, "var" );
- bud->features = g_slist_append(bud->features, g_strdup(feature) );
+ bud->features = g_slist_append( bud->features, g_strdup( feature ) );
c = c->next;
}
@@ -718,7 +723,8 @@ xt_status jabber_iq_parse_server_features( struct im_connection *ic, struct xt_n
c = c->next;
}
- } else if( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_DISCO_INFO ) == 0 )
+ }
+ else if( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_DISCO_INFO ) == 0 )
{
char *category, *type;
@@ -736,7 +742,8 @@ xt_status jabber_iq_parse_server_features( struct im_connection *ic, struct xt_n
c = c->next;
}
- } else if( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_BYTESTREAMS ) == 0 )
+ }
+ else if( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_BYTESTREAMS ) == 0 )
{
char *host, *jid;
int port;
@@ -760,5 +767,6 @@ xt_status jabber_iq_parse_server_features( struct im_connection *ic, struct xt_n
if( jd->have_streamhosts == 0 )
jd->have_streamhosts++;
+
return XT_HANDLED;
}