Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber_util.c

    r5bd21df r608f8cf  
    179179                return FALSE;
    180180        }
    181 }
    182 
    183 xt_status jabber_cache_handle_packet( struct im_connection *ic, struct xt_node *node )
    184 {
    185         struct jabber_data *jd = ic->proto_data;
    186         struct jabber_cache_entry *entry;
    187         char *s;
    188        
    189         if( ( s = xt_find_attr( node, "id" ) ) == NULL ||
    190             strncmp( s, jd->cached_id_prefix, strlen( jd->cached_id_prefix ) ) != 0 )
    191         {
    192                 /* Silently ignore it, without an ID (or a non-cache
    193                    ID) we don't know how to handle the packet and we
    194                    probably don't have to. */
    195                 return XT_HANDLED;
    196         }
    197        
    198         entry = g_hash_table_lookup( jd->node_cache, s );
    199        
    200         if( entry == NULL )
    201         {
    202                 imcb_log( ic, "WARNING: Received %s-%s packet with unknown/expired ID %s!",
    203                               node->name, xt_find_attr( node, "type" ) ? : "(no type)", s );
    204         }
    205         else if( entry->func )
    206         {
    207                 return entry->func( ic, node, entry->node );
    208         }
    209        
    210         return XT_HANDLED;
    211181}
    212182
     
    614584}
    615585
     586struct groupchat *jabber_chat_by_name( struct im_connection *ic, const char *name )
     587{
     588        char *normalized = jabber_normalize( name );
     589        struct groupchat *ret;
     590        struct jabber_chat *jc;
     591       
     592        for( ret = ic->groupchats; ret; ret = ret->next )
     593        {
     594                jc = ret->data;
     595                if( strcmp( normalized, jc->name ) == 0 )
     596                        break;
     597        }
     598        g_free( normalized );
     599       
     600        return ret;
     601}
     602
    616603time_t jabber_get_timestamp( struct xt_node *xt )
    617604{
     
    665652struct jabber_error *jabber_error_parse( struct xt_node *node, char *xmlns )
    666653{
    667         struct jabber_error *err;
     654        struct jabber_error *err = g_new0( struct jabber_error, 1 );
    668655        struct xt_node *c;
    669656        char *s;
    670657       
    671         if( node == NULL )
    672                 return NULL;
    673        
    674         err = g_new0( struct jabber_error, 1 );
    675658        err->type = xt_find_attr( node, "type" );
    676659       
Note: See TracChangeset for help on using the changeset viewer.