comparison mcabber/src/roster.c @ 92:c6270994fb6e

[/trunk] Changeset 106 by mikael * Add buddy to roster automatically if we receive a presence message and buddy is not already in the roster.
author mikael
date Mon, 18 Apr 2005 18:33:24 +0000
parents ac48ace7ee19
children d7fbd5293385
comparison
equal deleted inserted replaced
91:60eac956ce18 92:c6270994fb6e
199 { 199 {
200 GSList *sl_user; 200 GSList *sl_user;
201 roster *roster_usr; 201 roster *roster_usr;
202 202
203 sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT); 203 sl_user = roster_find(jid, jidsearch, ROSTER_TYPE_USER|ROSTER_TYPE_AGENT);
204 // If we can't find it, we add it
204 if (sl_user == NULL) 205 if (sl_user == NULL)
205 return; 206 sl_user = roster_add_user(jid, NULL, NULL, ROSTER_TYPE_USER);
206 207
207 roster_usr = (roster*)sl_user->data; 208 roster_usr = (roster*)sl_user->data;
208 roster_usr->status = bstat; 209 roster_usr->status = bstat;
209 } 210 }
210 211