Changes in user.c [38cc9d4:5b52a48]
Legend:
- Unmodified
- Added
- Removed
-
user.c
r38cc9d4 r5b52a48 67 67 68 68 u->user = u->realname = u->host = u->nick = g_strdup( nick ); 69 u->is_private = set_getint( irc, "private" );69 u->is_private = set_getint( &irc->set, "private" ); 70 70 71 71 key = g_strdup( nick ); … … 143 143 user_t *user_findhandle( struct gaim_connection *gc, char *handle ) 144 144 { 145 user_t *u = gc->irc->users; 146 147 while( u ) 148 { 149 if( u->gc == gc && u->handle && gc->prpl->cmp_buddynames ( u->handle, handle ) == 0 ) 150 break; 151 u = u->next; 152 } 153 154 return( u ); 145 user_t *u; 146 char *nick; 147 148 /* First, let's try a hash lookup. If it works, it's probably faster. */ 149 if( ( nick = g_hash_table_lookup( gc->acc->nicks, handle ) ) && 150 ( u = user_find( gc->irc, nick ) ) && 151 ( gc->acc->prpl->handle_cmp( handle, u->handle ) == 0 ) ) 152 return u; 153 154 /* However, it doesn't always work, so in that case we'll have to dig 155 through the whole userlist. :-( */ 156 for( u = gc->irc->users; u; u = u->next ) 157 if( u->gc == gc && u->handle && gc->acc->prpl->handle_cmp( u->handle, handle ) == 0 ) 158 return u; 159 160 return NULL; 155 161 } 156 162
Note: See TracChangeset
for help on using the changeset viewer.