Mercurial > pidgin
comparison libpurple/protocols/yahoo/yahoo_friend.c @ 31998:fcf841ffd620
Convert yahoo prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data()
author | andrew.victor@mxit.com |
---|---|
date | Tue, 30 Aug 2011 20:03:11 +0000 |
parents | a8cc50c2279f |
children |
comparison
equal
deleted
inserted
replaced
31997:1a3723704543 | 31998:fcf841ffd620 |
---|---|
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; |