Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/roster.c @ 1058:c0d44a9a99bc
Code cleanup
Cosmetics. Mostly get rid of "jid" variables, as it is a structure pointer
defined in libjabber/jabber.h.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 30 Nov 2006 19:51:09 +0100 |
parents | ebbde723614b |
children | 4e62941df777 |
comparison
equal
deleted
inserted
replaced
1057:4cdf19d9c74e | 1058:c0d44a9a99bc |
---|---|
262 // If roster_type is 0, returns match of any type. | 262 // If roster_type is 0, returns match of any type. |
263 // Returns the roster GSList element, or NULL if jid/name not found | 263 // Returns the roster GSList element, or NULL if jid/name not found |
264 GSList *roster_find(const char *jidname, enum findwhat type, guint roster_type) | 264 GSList *roster_find(const char *jidname, enum findwhat type, guint roster_type) |
265 { | 265 { |
266 GSList *sl_roster_elt = groups; | 266 GSList *sl_roster_elt = groups; |
267 GSList *res; | 267 GSList *resource; |
268 roster sample; | 268 roster sample; |
269 GCompareFunc comp; | 269 GCompareFunc comp; |
270 | 270 |
271 if (!jidname) return NULL; | 271 if (!jidname) return NULL; |
272 | 272 |
288 roster *roster_elt = (roster*)sl_roster_elt->data; | 288 roster *roster_elt = (roster*)sl_roster_elt->data; |
289 if (roster_type & ROSTER_TYPE_GROUP) { | 289 if (roster_type & ROSTER_TYPE_GROUP) { |
290 if ((type == namesearch) && !strcmp(jidname, roster_elt->name)) | 290 if ((type == namesearch) && !strcmp(jidname, roster_elt->name)) |
291 return sl_roster_elt; | 291 return sl_roster_elt; |
292 } | 292 } |
293 res = g_slist_find_custom(roster_elt->list, &sample, comp); | 293 resource = g_slist_find_custom(roster_elt->list, &sample, comp); |
294 if (res) return res; | 294 if (resource) return resource; |
295 sl_roster_elt = g_slist_next(sl_roster_elt); | 295 sl_roster_elt = g_slist_next(sl_roster_elt); |
296 } | 296 } |
297 return NULL; | 297 return NULL; |
298 } | 298 } |
299 | 299 |