comparison libpurple/protocols/yahoo/yahoo_friend.c @ 32819:2c6510167895 default tip

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24) to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 02 Jun 2012 02:30:49 +0000
parents fcf841ffd620
children
comparison
equal deleted inserted replaced
32818:01ff09d4a463 32819:2c6510167895
44 { 44 {
45 YahooData *yd; 45 YahooData *yd;
46 const char *norm; 46 const char *norm;
47 47
48 g_return_val_if_fail(gc != NULL, NULL); 48 g_return_val_if_fail(gc != NULL, NULL);
49 g_return_val_if_fail(gc->proto_data != NULL, NULL); 49
50 50 yd = purple_connection_get_protocol_data(gc);
51 yd = gc->proto_data; 51 g_return_val_if_fail(yd != NULL, NULL);
52
52 norm = purple_normalize(purple_connection_get_account(gc), name); 53 norm = purple_normalize(purple_connection_get_account(gc), name);
53 54
54 return g_hash_table_lookup(yd->friends, norm); 55 return g_hash_table_lookup(yd->friends, norm);
55 } 56 }
56 57
59 YahooFriend *f; 60 YahooFriend *f;
60 YahooData *yd; 61 YahooData *yd;
61 const char *norm; 62 const char *norm;
62 63
63 g_return_val_if_fail(gc != NULL, NULL); 64 g_return_val_if_fail(gc != NULL, NULL);
64 g_return_val_if_fail(gc->proto_data != NULL, NULL); 65
65 66 yd = purple_connection_get_protocol_data(gc);
66 yd = gc->proto_data; 67 g_return_val_if_fail(yd != NULL, NULL);
68
67 norm = purple_normalize(purple_connection_get_account(gc), name); 69 norm = purple_normalize(purple_connection_get_account(gc), name);
68 70
69 f = g_hash_table_lookup(yd->friends, norm); 71 f = g_hash_table_lookup(yd->friends, norm);
70 if (!f) { 72 if (!f) {
71 f = yahoo_friend_new(); 73 f = yahoo_friend_new();
223 } 225 }
224 226
225 void yahoo_friend_update_presence(PurpleConnection *gc, const char *name, 227 void yahoo_friend_update_presence(PurpleConnection *gc, const char *name,
226 YahooPresenceVisibility presence) 228 YahooPresenceVisibility presence)
227 { 229 {
228 YahooData *yd = gc->proto_data; 230 YahooData *yd = purple_connection_get_protocol_data(gc);
229 struct yahoo_packet *pkt = NULL; 231 struct yahoo_packet *pkt = NULL;
230 YahooFriend *f; 232 YahooFriend *f;
231 const char *thirtyone, *thirteen; 233 const char *thirtyone, *thirteen;
232 int service = -1; 234 int service = -1;
233 const char *temp = NULL; 235 const char *temp = NULL;