Changeset 2ecfe39


Ignore:
Timestamp:
2008-02-17T02:12:09Z (12 years ago)
Author:
Sven Moritz Hallberg <sm@…>
Branches:
master
Children:
d858d21
Parents:
37bff51 (diff), 2d88d25a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

more upstream changes

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r37bff51 r2ecfe39  
    526526}
    527527
     528static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
     529
    528530int jabber_add_to_roster( struct im_connection *ic, char *handle, char *name )
    529531{
     
    541543        xt_add_attr( node, "xmlns", XMLNS_ROSTER );
    542544        node = jabber_make_packet( "iq", "set", NULL, node );
     545        jabber_cache_add( ic, node, jabber_add_to_roster_callback );
    543546       
    544547        st = jabber_write_packet( ic, node );
    545548       
    546         xt_free_node( node );
    547549        return st;
     550}
     551
     552static xt_status jabber_add_to_roster_callback( struct im_connection *ic, struct xt_node *node, struct xt_node *orig )
     553{
     554        char *s, *jid = NULL;
     555        struct xt_node *c;
     556       
     557        if( ( c = xt_find_node( orig->children, "query" ) ) &&
     558            ( c = xt_find_node( c->children, "item" ) ) &&
     559            ( jid = xt_find_attr( c, "jid" ) ) &&
     560            ( s = xt_find_attr( node, "type" ) ) &&
     561            strcmp( s, "result" ) == 0 )
     562        {
     563                if( imcb_find_buddy( ic, jid ) == NULL )
     564                        imcb_add_buddy( ic, jid, NULL );
     565        }
     566        else
     567        {
     568                imcb_log( ic, "Error while adding `%s' to your contact list.",
     569                          jid ? jid : "(unknown handle)" );
     570        }
     571       
     572        return XT_HANDLED;
    548573}
    549574
  • tests/check_help.c

    r37bff51 r2ecfe39  
    77#include "help.h"
    88
    9 START_TEST(test_help_none)
     9START_TEST(test_help_initfree)
    1010        help_t *h, *r;
    1111        r = help_init(&h, "/dev/null");
    1212        fail_if(r == NULL);
    1313        fail_if(r != h);
     14       
     15        help_free(&h);
     16        fail_if(h != NULL);
    1417END_TEST
    1518
     
    2528        TCase *tc_core = tcase_create("Core");
    2629        suite_add_tcase (s, tc_core);
    27         tcase_add_test (tc_core, test_help_none);
     30        tcase_add_test (tc_core, test_help_initfree);
    2831        tcase_add_test (tc_core, test_help_nonexistent);
    2932        return s;
  • tests/check_jabber_sasl.c

    r37bff51 r2ecfe39  
    1818struct
    1919{
    20         const char *challenge;
     20        char *challenge;
    2121        char *key;
    2222        char *value;
Note: See TracChangeset for help on using the changeset viewer.