Mercurial > pidgin
comparison src/blist.c @ 10389:c432b927b0b1
[gaim-migrate @ 11616]
Cleaned up "use_server_alias" some more and removed the timestamp option.
Default: Yes. The timestamp plugin will override this, however; also the
timestamp is now centered in the conversation.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 16 Dec 2004 05:34:34 +0000 |
parents | 28135f8c226d |
children | aab0c9508318 |
comparison
equal
deleted
inserted
replaced
10388:088633feb846 | 10389:c432b927b0b1 |
---|---|
94 { | 94 { |
95 g_free(hb->name); | 95 g_free(hb->name); |
96 g_free(hb); | 96 g_free(hb); |
97 } | 97 } |
98 | 98 |
99 static void blist_pref_cb(const char *name, GaimPrefType type, gpointer value, gpointer data) | |
100 { | |
101 GaimBlistUiOps *ops = gaimbuddylist->ui_ops; | |
102 GaimBlistNode *gnode, *cnode, *bnode; | |
103 | |
104 if (!ops || !ops->update) | |
105 return; | |
106 | |
107 for (gnode = gaimbuddylist->root; gnode; gnode = gnode->next) { | |
108 if (!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
109 continue; | |
110 for (cnode = gnode->child; cnode; cnode = cnode->next) { | |
111 if (GAIM_BLIST_NODE_IS_CONTACT(cnode)) { | |
112 for (bnode = cnode->child; bnode; bnode = bnode->next) { | |
113 if (!GAIM_BLIST_NODE_IS_BUDDY(bnode)) | |
114 continue; | |
115 ops->update(gaimbuddylist, bnode); | |
116 } | |
117 } else if (GAIM_BLIST_NODE_IS_CHAT(cnode)) { | |
118 ops->update(gaimbuddylist, cnode); | |
119 } | |
120 } | |
121 } | |
122 } | |
123 | |
124 void gaim_contact_invalidate_priority_buddy(GaimContact *contact) | 99 void gaim_contact_invalidate_priority_buddy(GaimContact *contact) |
125 { | 100 { |
126 g_return_if_fail(contact != NULL); | 101 g_return_if_fail(contact != NULL); |
127 | 102 |
128 contact->priority_valid = FALSE; | 103 contact->priority_valid = FALSE; |
199 (GEqualFunc)_gaim_blist_hbuddy_equal, | 174 (GEqualFunc)_gaim_blist_hbuddy_equal, |
200 (GDestroyNotify)_gaim_blist_hbuddy_free_key, NULL); | 175 (GDestroyNotify)_gaim_blist_hbuddy_free_key, NULL); |
201 | 176 |
202 if (gbl->ui_ops != NULL && gbl->ui_ops->new_list != NULL) | 177 if (gbl->ui_ops != NULL && gbl->ui_ops->new_list != NULL) |
203 gbl->ui_ops->new_list(gbl); | 178 gbl->ui_ops->new_list(gbl); |
204 | |
205 gaim_prefs_connect_callback(gaim_blist_get_handle(), "/core/buddies/use_server_alias", | |
206 blist_pref_cb, NULL); | |
207 | 179 |
208 return gbl; | 180 return gbl; |
209 } | 181 } |
210 | 182 |
211 void | 183 void |
1411 g_return_val_if_fail(buddy != NULL, NULL); | 1383 g_return_val_if_fail(buddy != NULL, NULL); |
1412 | 1384 |
1413 if ((buddy->alias != NULL) && (*buddy->alias != '\0')) { | 1385 if ((buddy->alias != NULL) && (*buddy->alias != '\0')) { |
1414 return buddy->alias; | 1386 return buddy->alias; |
1415 } else if ((buddy->server_alias != NULL) && | 1387 } else if ((buddy->server_alias != NULL) && |
1416 (*buddy->server_alias != '\0') && | 1388 (*buddy->server_alias != '\0')) { |
1417 (gaim_prefs_get_bool("/core/buddies/use_server_alias"))) { | |
1418 | 1389 |
1419 return buddy->server_alias; | 1390 return buddy->server_alias; |
1420 } | 1391 } |
1421 | 1392 |
1422 return NULL; | 1393 return NULL; |
1456 /* The buddy alias */ | 1427 /* The buddy alias */ |
1457 if (buddy->alias != NULL) | 1428 if (buddy->alias != NULL) |
1458 return buddy->alias; | 1429 return buddy->alias; |
1459 | 1430 |
1460 /* The server alias, if preferences say so */ | 1431 /* The server alias, if preferences say so */ |
1461 if ((buddy->server_alias) && (*buddy->server_alias) && | 1432 if ((buddy->server_alias) && (*buddy->server_alias)) |
1462 (gaim_prefs_get_bool("/core/buddies/use_server_alias"))) | |
1463 return buddy->server_alias; | 1433 return buddy->server_alias; |
1464 | 1434 |
1465 /* The buddy's user name (i.e. no alias) */ | 1435 /* The buddy's user name (i.e. no alias) */ |
1466 return buddy->name; | 1436 return buddy->name; |
1467 } | 1437 } |