Mercurial > pidgin.yaz
comparison libpurple/protocols/sametime/sametime.c @ 32458:1a3723704543
Convert sametime 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 19:32:08 +0000 |
parents | b6defcebfe4b |
children | cd1d9e04c587 |
comparison
equal
deleted
inserted
replaced
32457:b48dfbb514d3 | 32458:1a3723704543 |
---|---|
195 /** handler IDs from g_log_set_handler in mw_plugin_init */ | 195 /** handler IDs from g_log_set_handler in mw_plugin_init */ |
196 static guint log_handler[2] = { 0, 0 }; | 196 static guint log_handler[2] = { 0, 0 }; |
197 | 197 |
198 | 198 |
199 /** the purple plugin data. | 199 /** the purple plugin data. |
200 available as gc->proto_data and mwSession_getClientData */ | 200 available as purple_connection_get_protocol_data(gc) and mwSession_getClientData */ |
201 struct mwPurplePluginData { | 201 struct mwPurplePluginData { |
202 struct mwSession *session; | 202 struct mwSession *session; |
203 | 203 |
204 struct mwServiceAware *srvc_aware; | 204 struct mwServiceAware *srvc_aware; |
205 struct mwServiceConference *srvc_conf; | 205 struct mwServiceConference *srvc_conf; |
318 static struct mwSession *gc_to_session(PurpleConnection *gc) { | 318 static struct mwSession *gc_to_session(PurpleConnection *gc) { |
319 struct mwPurplePluginData *pd; | 319 struct mwPurplePluginData *pd; |
320 | 320 |
321 g_return_val_if_fail(gc != NULL, NULL); | 321 g_return_val_if_fail(gc != NULL, NULL); |
322 | 322 |
323 pd = gc->proto_data; | 323 pd = purple_connection_get_protocol_data(gc); |
324 g_return_val_if_fail(pd != NULL, NULL); | 324 g_return_val_if_fail(pd != NULL, NULL); |
325 | 325 |
326 return pd->session; | 326 return pd->session; |
327 } | 327 } |
328 | 328 |
497 const char *status = MW_STATE_ACTIVE; | 497 const char *status = MW_STATE_ACTIVE; |
498 | 498 |
499 gc = mwAwareList_getClientData(list); | 499 gc = mwAwareList_getClientData(list); |
500 acct = purple_connection_get_account(gc); | 500 acct = purple_connection_get_account(gc); |
501 | 501 |
502 pd = gc->proto_data; | 502 pd = purple_connection_get_protocol_data(gc); |
503 idle = aware->status.time; | 503 idle = aware->status.time; |
504 stat = aware->status.status; | 504 stat = aware->status.status; |
505 id = aware->id.user; | 505 id = aware->id.user; |
506 | 506 |
507 if(idle) { | 507 if(idle) { |
849 /** ensure that a PurpleBuddy exists in the group with data | 849 /** ensure that a PurpleBuddy exists in the group with data |
850 appropriately matching the st user entry from the st list */ | 850 appropriately matching the st user entry from the st list */ |
851 static PurpleBuddy *buddy_ensure(PurpleConnection *gc, PurpleGroup *group, | 851 static PurpleBuddy *buddy_ensure(PurpleConnection *gc, PurpleGroup *group, |
852 struct mwSametimeUser *stuser) { | 852 struct mwSametimeUser *stuser) { |
853 | 853 |
854 struct mwPurplePluginData *pd = gc->proto_data; | 854 struct mwPurplePluginData *pd = purple_connection_get_protocol_data(gc); |
855 PurpleBuddy *buddy; | 855 PurpleBuddy *buddy; |
856 PurpleAccount *acct = purple_connection_get_account(gc); | 856 PurpleAccount *acct = purple_connection_get_account(gc); |
857 | 857 |
858 const char *id = mwSametimeUser_getUser(stuser); | 858 const char *id = mwSametimeUser_getUser(stuser); |
859 const char *name = mwSametimeUser_getShortName(stuser); | 859 const char *name = mwSametimeUser_getShortName(stuser); |
966 purple_blist_node_set_string(gn, GROUP_KEY_NAME, name); | 966 purple_blist_node_set_string(gn, GROUP_KEY_NAME, name); |
967 purple_blist_node_set_int(gn, GROUP_KEY_TYPE, type); | 967 purple_blist_node_set_int(gn, GROUP_KEY_TYPE, type); |
968 | 968 |
969 if(type == mwSametimeGroup_DYNAMIC) { | 969 if(type == mwSametimeGroup_DYNAMIC) { |
970 purple_blist_node_set_string(gn, GROUP_KEY_OWNER, owner); | 970 purple_blist_node_set_string(gn, GROUP_KEY_OWNER, owner); |
971 group_add(gc->proto_data, group); | 971 group_add(purple_connection_get_protocol_data(gc), group); |
972 } | 972 } |
973 | 973 |
974 return group; | 974 return group; |
975 } | 975 } |
976 | 976 |
3190 | 3190 |
3191 mwSession_addCipher(pd->session, mwCipher_new_RC2_40(pd->session)); | 3191 mwSession_addCipher(pd->session, mwCipher_new_RC2_40(pd->session)); |
3192 mwSession_addCipher(pd->session, mwCipher_new_RC2_128(pd->session)); | 3192 mwSession_addCipher(pd->session, mwCipher_new_RC2_128(pd->session)); |
3193 | 3193 |
3194 mwSession_setClientData(pd->session, pd, NULL); | 3194 mwSession_setClientData(pd->session, pd, NULL); |
3195 gc->proto_data = pd; | 3195 purple_connection_set_protocol_data(gc, pd); |
3196 | 3196 |
3197 return pd; | 3197 return pd; |
3198 } | 3198 } |
3199 | 3199 |
3200 | 3200 |
3201 static void mwPurplePluginData_free(struct mwPurplePluginData *pd) { | 3201 static void mwPurplePluginData_free(struct mwPurplePluginData *pd) { |
3202 g_return_if_fail(pd != NULL); | 3202 g_return_if_fail(pd != NULL); |
3203 | 3203 |
3204 pd->gc->proto_data = NULL; | 3204 purple_connection_set_protocol_data(pd->gc, NULL); |
3205 | 3205 |
3206 mwSession_removeService(pd->session, mwService_AWARE); | 3206 mwSession_removeService(pd->session, mwService_AWARE); |
3207 mwSession_removeService(pd->session, mwService_CONFERENCE); | 3207 mwSession_removeService(pd->session, mwService_CONFERENCE); |
3208 mwSession_removeService(pd->session, mwService_FILE_TRANSFER); | 3208 mwSession_removeService(pd->session, mwService_FILE_TRANSFER); |
3209 mwSession_removeService(pd->session, mwService_IM); | 3209 mwSession_removeService(pd->session, mwService_IM); |
3261 struct mwPurplePluginData *pd; | 3261 struct mwPurplePluginData *pd; |
3262 struct mwAwareIdBlock t = { mwAware_USER, (char *)purple_buddy_get_name(b), NULL }; | 3262 struct mwAwareIdBlock t = { mwAware_USER, (char *)purple_buddy_get_name(b), NULL }; |
3263 const char *ret = NULL; | 3263 const char *ret = NULL; |
3264 | 3264 |
3265 if ((gc = purple_account_get_connection(purple_buddy_get_account(b))) | 3265 if ((gc = purple_account_get_connection(purple_buddy_get_account(b))) |
3266 && (pd = gc->proto_data)) | 3266 && (pd = purple_connection_get_protocol_data(gc))) |
3267 ret = mwServiceAware_getText(pd->srvc_aware, &t); | 3267 ret = mwServiceAware_getText(pd->srvc_aware, &t); |
3268 | 3268 |
3269 return (ret && g_utf8_validate(ret, -1, NULL)) ? g_markup_escape_text(ret, -1): NULL; | 3269 return (ret && g_utf8_validate(ret, -1, NULL)) ? g_markup_escape_text(ret, -1): NULL; |
3270 } | 3270 } |
3271 | 3271 |
3324 const char *message = NULL; | 3324 const char *message = NULL; |
3325 const char *status; | 3325 const char *status; |
3326 char *tmp; | 3326 char *tmp; |
3327 | 3327 |
3328 if ((gc = purple_account_get_connection(purple_buddy_get_account(b))) | 3328 if ((gc = purple_account_get_connection(purple_buddy_get_account(b))) |
3329 && (pd = gc->proto_data)) | 3329 && (pd = purple_connection_get_protocol_data(gc))) |
3330 message = mwServiceAware_getText(pd->srvc_aware, &idb); | 3330 message = mwServiceAware_getText(pd->srvc_aware, &idb); |
3331 | 3331 |
3332 status = status_text(b); | 3332 status = status_text(b); |
3333 | 3333 |
3334 if(message != NULL && g_utf8_validate(message, -1, NULL) && purple_utf8_strcasecmp(status, message)) { | 3334 if(message != NULL && g_utf8_validate(message, -1, NULL) && purple_utf8_strcasecmp(status, message)) { |
3401 struct mwConference *conf; | 3401 struct mwConference *conf; |
3402 struct mwIdBlock idb = { NULL, NULL }; | 3402 struct mwIdBlock idb = { NULL, NULL }; |
3403 | 3403 |
3404 acct = purple_buddy_get_account(buddy); | 3404 acct = purple_buddy_get_account(buddy); |
3405 gc = purple_account_get_connection(acct); | 3405 gc = purple_account_get_connection(acct); |
3406 pd = gc->proto_data; | 3406 pd = purple_connection_get_protocol_data(gc); |
3407 srvc = pd->srvc_conf; | 3407 srvc = pd->srvc_conf; |
3408 | 3408 |
3409 f = purple_request_fields_get_field(fields, CHAT_KEY_TOPIC); | 3409 f = purple_request_fields_get_field(fields, CHAT_KEY_TOPIC); |
3410 topic = purple_request_field_string_get_value(f); | 3410 topic = purple_request_field_string_get_value(f); |
3411 | 3411 |
3567 g_return_if_fail(acct != NULL); | 3567 g_return_if_fail(acct != NULL); |
3568 | 3568 |
3569 gc = purple_account_get_connection(acct); | 3569 gc = purple_account_get_connection(acct); |
3570 g_return_if_fail(gc != NULL); | 3570 g_return_if_fail(gc != NULL); |
3571 | 3571 |
3572 pd = gc->proto_data; | 3572 pd = purple_connection_get_protocol_data(gc); |
3573 g_return_if_fail(pd != NULL); | 3573 g_return_if_fail(pd != NULL); |
3574 | 3574 |
3575 /* | 3575 /* |
3576 - get a list of all conferences on this session | 3576 - get a list of all conferences on this session |
3577 - if none, prompt to create one, and invite buddy to it | 3577 - if none, prompt to create one, and invite buddy to it |
3606 g_return_if_fail(acct != NULL); | 3606 g_return_if_fail(acct != NULL); |
3607 | 3607 |
3608 gc = purple_account_get_connection(acct); | 3608 gc = purple_account_get_connection(acct); |
3609 g_return_if_fail(gc != NULL); | 3609 g_return_if_fail(gc != NULL); |
3610 | 3610 |
3611 pd = gc->proto_data; | 3611 pd = purple_connection_get_protocol_data(gc); |
3612 g_return_if_fail(pd != NULL); | 3612 g_return_if_fail(pd != NULL); |
3613 | 3613 |
3614 rcpt_name = g_strdup_printf("@U %s", buddy->name); | 3614 rcpt_name = g_strdup_printf("@U %s", buddy->name); |
3615 rcpt = g_list_prepend(NULL, rcpt_name); | 3615 rcpt = g_list_prepend(NULL, rcpt_name); |
3616 | 3616 |
3811 static void mw_prpl_close(PurpleConnection *gc) { | 3811 static void mw_prpl_close(PurpleConnection *gc) { |
3812 struct mwPurplePluginData *pd; | 3812 struct mwPurplePluginData *pd; |
3813 | 3813 |
3814 g_return_if_fail(gc != NULL); | 3814 g_return_if_fail(gc != NULL); |
3815 | 3815 |
3816 pd = gc->proto_data; | 3816 pd = purple_connection_get_protocol_data(gc); |
3817 g_return_if_fail(pd != NULL); | 3817 g_return_if_fail(pd != NULL); |
3818 | 3818 |
3819 /* get rid of the blist save timeout */ | 3819 /* get rid of the blist save timeout */ |
3820 if(pd->save_event) { | 3820 if(pd->save_event) { |
3821 purple_timeout_remove(pd->save_event); | 3821 purple_timeout_remove(pd->save_event); |
3825 | 3825 |
3826 /* stop the session */ | 3826 /* stop the session */ |
3827 mwSession_stop(pd->session, 0x00); | 3827 mwSession_stop(pd->session, 0x00); |
3828 | 3828 |
3829 /* no longer necessary */ | 3829 /* no longer necessary */ |
3830 gc->proto_data = NULL; | 3830 purple_connection_set_protocol_data(gc, NULL); |
3831 | 3831 |
3832 /* stop watching the socket */ | 3832 /* stop watching the socket */ |
3833 if(gc->inpa) { | 3833 if(gc->inpa) { |
3834 purple_input_remove(gc->inpa); | 3834 purple_input_remove(gc->inpa); |
3835 gc->inpa = 0; | 3835 gc->inpa = 0; |
4016 struct mwPurplePluginData *pd; | 4016 struct mwPurplePluginData *pd; |
4017 struct mwIdBlock who = { (char *) name, NULL }; | 4017 struct mwIdBlock who = { (char *) name, NULL }; |
4018 struct mwConversation *conv; | 4018 struct mwConversation *conv; |
4019 | 4019 |
4020 g_return_val_if_fail(gc != NULL, 0); | 4020 g_return_val_if_fail(gc != NULL, 0); |
4021 pd = gc->proto_data; | 4021 pd = purple_connection_get_protocol_data(gc); |
4022 | 4022 |
4023 g_return_val_if_fail(pd != NULL, 0); | 4023 g_return_val_if_fail(pd != NULL, 0); |
4024 | 4024 |
4025 conv = mwServiceIm_getConversation(pd->srvc_im, &who); | 4025 conv = mwServiceIm_getConversation(pd->srvc_im, &who); |
4026 | 4026 |
4091 struct mwConversation *conv; | 4091 struct mwConversation *conv; |
4092 | 4092 |
4093 gpointer t = GINT_TO_POINTER(!! state); | 4093 gpointer t = GINT_TO_POINTER(!! state); |
4094 | 4094 |
4095 g_return_val_if_fail(gc != NULL, 0); | 4095 g_return_val_if_fail(gc != NULL, 0); |
4096 pd = gc->proto_data; | 4096 pd = purple_connection_get_protocol_data(gc); |
4097 | 4097 |
4098 g_return_val_if_fail(pd != NULL, 0); | 4098 g_return_val_if_fail(pd != NULL, 0); |
4099 | 4099 |
4100 conv = mwServiceIm_getConversation(pd->srvc_im, &who); | 4100 conv = mwServiceIm_getConversation(pd->srvc_im, &who); |
4101 | 4101 |
4187 const char *tmp2; | 4187 const char *tmp2; |
4188 | 4188 |
4189 g_return_if_fail(who != NULL); | 4189 g_return_if_fail(who != NULL); |
4190 g_return_if_fail(*who != '\0'); | 4190 g_return_if_fail(*who != '\0'); |
4191 | 4191 |
4192 pd = gc->proto_data; | 4192 pd = purple_connection_get_protocol_data(gc); |
4193 | 4193 |
4194 acct = purple_connection_get_account(gc); | 4194 acct = purple_connection_get_account(gc); |
4195 b = purple_find_buddy(acct, who); | 4195 b = purple_find_buddy(acct, who); |
4196 user_info = purple_notify_user_info_new(); | 4196 user_info = purple_notify_user_info_new(); |
4197 | 4197 |
4432 g_return_if_fail(data != NULL); | 4432 g_return_if_fail(data != NULL); |
4433 | 4433 |
4434 buddy = data->buddy; | 4434 buddy = data->buddy; |
4435 | 4435 |
4436 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); | 4436 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); |
4437 pd = gc->proto_data; | 4437 pd = purple_connection_get_protocol_data(gc); |
4438 | 4438 |
4439 if(results) | 4439 if(results) |
4440 res = results->data; | 4440 res = results->data; |
4441 | 4441 |
4442 if(!code && res && res->matches) { | 4442 if(!code && res && res->matches) { |
4513 | 4513 |
4514 static void mw_prpl_add_buddy(PurpleConnection *gc, | 4514 static void mw_prpl_add_buddy(PurpleConnection *gc, |
4515 PurpleBuddy *buddy, | 4515 PurpleBuddy *buddy, |
4516 PurpleGroup *group) { | 4516 PurpleGroup *group) { |
4517 | 4517 |
4518 struct mwPurplePluginData *pd = gc->proto_data; | 4518 struct mwPurplePluginData *pd = purple_connection_get_protocol_data(gc); |
4519 struct mwServiceResolve *srvc; | 4519 struct mwServiceResolve *srvc; |
4520 GList *query; | 4520 GList *query; |
4521 enum mwResolveFlag flags; | 4521 enum mwResolveFlag flags; |
4522 guint32 req; | 4522 guint32 req; |
4523 BuddyAddData *data; | 4523 BuddyAddData *data; |
4564 | 4564 |
4565 struct mwPurplePluginData *pd; | 4565 struct mwPurplePluginData *pd; |
4566 GHashTable *group_sets; | 4566 GHashTable *group_sets; |
4567 struct mwAwareIdBlock *idbs, *idb; | 4567 struct mwAwareIdBlock *idbs, *idb; |
4568 | 4568 |
4569 pd = gc->proto_data; | 4569 pd = purple_connection_get_protocol_data(gc); |
4570 | 4570 |
4571 /* map PurpleGroup:GList of mwAwareIdBlock */ | 4571 /* map PurpleGroup:GList of mwAwareIdBlock */ |
4572 group_sets = g_hash_table_new(g_direct_hash, g_direct_equal); | 4572 group_sets = g_hash_table_new(g_direct_hash, g_direct_equal); |
4573 | 4573 |
4574 /* bunch of mwAwareIdBlock allocated at once, free'd at once */ | 4574 /* bunch of mwAwareIdBlock allocated at once, free'd at once */ |
4615 struct mwAwareIdBlock idb = { mwAware_USER, (char *)purple_buddy_get_name(buddy), NULL }; | 4615 struct mwAwareIdBlock idb = { mwAware_USER, (char *)purple_buddy_get_name(buddy), NULL }; |
4616 struct mwAwareList *list; | 4616 struct mwAwareList *list; |
4617 | 4617 |
4618 GList *rem = g_list_prepend(NULL, &idb); | 4618 GList *rem = g_list_prepend(NULL, &idb); |
4619 | 4619 |
4620 pd = gc->proto_data; | 4620 pd = purple_connection_get_protocol_data(gc); |
4621 group = purple_buddy_get_group(buddy); | 4621 group = purple_buddy_get_group(buddy); |
4622 list = list_ensure(pd, group); | 4622 list = list_ensure(pd, group); |
4623 | 4623 |
4624 mwAwareList_removeAware(list, rem); | 4624 mwAwareList_removeAware(list, rem); |
4625 blist_schedule(pd); | 4625 blist_schedule(pd); |
4662 g_return_if_fail(gc != NULL); | 4662 g_return_if_fail(gc != NULL); |
4663 | 4663 |
4664 acct = purple_connection_get_account(gc); | 4664 acct = purple_connection_get_account(gc); |
4665 g_return_if_fail(acct != NULL); | 4665 g_return_if_fail(acct != NULL); |
4666 | 4666 |
4667 pd = gc->proto_data; | 4667 pd = purple_connection_get_protocol_data(gc); |
4668 g_return_if_fail(pd != NULL); | 4668 g_return_if_fail(pd != NULL); |
4669 | 4669 |
4670 session = pd->session; | 4670 session = pd->session; |
4671 g_return_if_fail(session != NULL); | 4671 g_return_if_fail(session != NULL); |
4672 | 4672 |
4746 GHashTable *components) { | 4746 GHashTable *components) { |
4747 | 4747 |
4748 struct mwPurplePluginData *pd; | 4748 struct mwPurplePluginData *pd; |
4749 char *c, *t; | 4749 char *c, *t; |
4750 | 4750 |
4751 pd = gc->proto_data; | 4751 pd = purple_connection_get_protocol_data(gc); |
4752 | 4752 |
4753 c = g_hash_table_lookup(components, CHAT_KEY_NAME); | 4753 c = g_hash_table_lookup(components, CHAT_KEY_NAME); |
4754 t = g_hash_table_lookup(components, CHAT_KEY_TOPIC); | 4754 t = g_hash_table_lookup(components, CHAT_KEY_TOPIC); |
4755 | 4755 |
4756 if(g_hash_table_lookup(components, CHAT_KEY_IS_PLACE)) { | 4756 if(g_hash_table_lookup(components, CHAT_KEY_IS_PLACE)) { |
4788 | 4788 |
4789 struct mwPurplePluginData *pd; | 4789 struct mwPurplePluginData *pd; |
4790 struct mwServiceConference *srvc; | 4790 struct mwServiceConference *srvc; |
4791 char *c; | 4791 char *c; |
4792 | 4792 |
4793 pd = gc->proto_data; | 4793 pd = purple_connection_get_protocol_data(gc); |
4794 srvc = pd->srvc_conf; | 4794 srvc = pd->srvc_conf; |
4795 | 4795 |
4796 if(g_hash_table_lookup(components, CHAT_KEY_IS_PLACE)) { | 4796 if(g_hash_table_lookup(components, CHAT_KEY_IS_PLACE)) { |
4797 ; /* nothing needs doing */ | 4797 ; /* nothing needs doing */ |
4798 | 4798 |
4820 struct mwPurplePluginData *pd; | 4820 struct mwPurplePluginData *pd; |
4821 struct mwConference *conf; | 4821 struct mwConference *conf; |
4822 struct mwPlace *place; | 4822 struct mwPlace *place; |
4823 struct mwIdBlock idb = { (char *) who, NULL }; | 4823 struct mwIdBlock idb = { (char *) who, NULL }; |
4824 | 4824 |
4825 pd = gc->proto_data; | 4825 pd = purple_connection_get_protocol_data(gc); |
4826 g_return_if_fail(pd != NULL); | 4826 g_return_if_fail(pd != NULL); |
4827 | 4827 |
4828 conf = ID_TO_CONF(pd, id); | 4828 conf = ID_TO_CONF(pd, id); |
4829 | 4829 |
4830 if(conf) { | 4830 if(conf) { |
4844 int id) { | 4844 int id) { |
4845 | 4845 |
4846 struct mwPurplePluginData *pd; | 4846 struct mwPurplePluginData *pd; |
4847 struct mwConference *conf; | 4847 struct mwConference *conf; |
4848 | 4848 |
4849 pd = gc->proto_data; | 4849 pd = purple_connection_get_protocol_data(gc); |
4850 | 4850 |
4851 g_return_if_fail(pd != NULL); | 4851 g_return_if_fail(pd != NULL); |
4852 conf = ID_TO_CONF(pd, id); | 4852 conf = ID_TO_CONF(pd, id); |
4853 | 4853 |
4854 if(conf) { | 4854 if(conf) { |
4880 struct mwPurplePluginData *pd; | 4880 struct mwPurplePluginData *pd; |
4881 struct mwConference *conf; | 4881 struct mwConference *conf; |
4882 char *msg; | 4882 char *msg; |
4883 int ret; | 4883 int ret; |
4884 | 4884 |
4885 pd = gc->proto_data; | 4885 pd = purple_connection_get_protocol_data(gc); |
4886 | 4886 |
4887 g_return_val_if_fail(pd != NULL, 0); | 4887 g_return_val_if_fail(pd != NULL, 0); |
4888 conf = ID_TO_CONF(pd, id); | 4888 conf = ID_TO_CONF(pd, id); |
4889 | 4889 |
4890 msg = purple_markup_strip_html(message); | 4890 msg = purple_markup_strip_html(message); |
4918 | 4918 |
4919 static void mw_prpl_alias_buddy(PurpleConnection *gc, | 4919 static void mw_prpl_alias_buddy(PurpleConnection *gc, |
4920 const char *who, | 4920 const char *who, |
4921 const char *alias) { | 4921 const char *alias) { |
4922 | 4922 |
4923 struct mwPurplePluginData *pd = gc->proto_data; | 4923 struct mwPurplePluginData *pd = purple_connection_get_protocol_data(gc); |
4924 g_return_if_fail(pd != NULL); | 4924 g_return_if_fail(pd != NULL); |
4925 | 4925 |
4926 /* it's a change to the buddy list, so we've gotta reflect that in | 4926 /* it's a change to the buddy list, so we've gotta reflect that in |
4927 the server copy */ | 4927 the server copy */ |
4928 | 4928 |
4936 const char *new_group) { | 4936 const char *new_group) { |
4937 | 4937 |
4938 struct mwAwareIdBlock idb = { mwAware_USER, (char *) who, NULL }; | 4938 struct mwAwareIdBlock idb = { mwAware_USER, (char *) who, NULL }; |
4939 GList *gl = g_list_prepend(NULL, &idb); | 4939 GList *gl = g_list_prepend(NULL, &idb); |
4940 | 4940 |
4941 struct mwPurplePluginData *pd = gc->proto_data; | 4941 struct mwPurplePluginData *pd = purple_connection_get_protocol_data(gc); |
4942 PurpleGroup *group; | 4942 PurpleGroup *group; |
4943 struct mwAwareList *list; | 4943 struct mwAwareList *list; |
4944 | 4944 |
4945 /* add who to new_group's aware list */ | 4945 /* add who to new_group's aware list */ |
4946 group = purple_find_group(new_group); | 4946 group = purple_find_group(new_group); |
4962 static void mw_prpl_rename_group(PurpleConnection *gc, | 4962 static void mw_prpl_rename_group(PurpleConnection *gc, |
4963 const char *old, | 4963 const char *old, |
4964 PurpleGroup *group, | 4964 PurpleGroup *group, |
4965 GList *buddies) { | 4965 GList *buddies) { |
4966 | 4966 |
4967 struct mwPurplePluginData *pd = gc->proto_data; | 4967 struct mwPurplePluginData *pd = purple_connection_get_protocol_data(gc); |
4968 g_return_if_fail(pd != NULL); | 4968 g_return_if_fail(pd != NULL); |
4969 | 4969 |
4970 /* it's a change in the buddy list, so we've gotta reflect that in | 4970 /* it's a change in the buddy list, so we've gotta reflect that in |
4971 the server copy. Also, having this function should prevent all | 4971 the server copy. Also, having this function should prevent all |
4972 those buddies from being removed and re-added. We don't really | 4972 those buddies from being removed and re-added. We don't really |
4982 ; | 4982 ; |
4983 } | 4983 } |
4984 | 4984 |
4985 | 4985 |
4986 static void mw_prpl_convo_closed(PurpleConnection *gc, const char *who) { | 4986 static void mw_prpl_convo_closed(PurpleConnection *gc, const char *who) { |
4987 struct mwPurplePluginData *pd = gc->proto_data; | 4987 struct mwPurplePluginData *pd = purple_connection_get_protocol_data(gc); |
4988 struct mwServiceIm *srvc; | 4988 struct mwServiceIm *srvc; |
4989 struct mwConversation *conv; | 4989 struct mwConversation *conv; |
4990 struct mwIdBlock idb = { (char *) who, NULL }; | 4990 struct mwIdBlock idb = { (char *) who, NULL }; |
4991 | 4991 |
4992 g_return_if_fail(pd != NULL); | 4992 g_return_if_fail(pd != NULL); |
5017 | 5017 |
5018 static void mw_prpl_remove_group(PurpleConnection *gc, PurpleGroup *group) { | 5018 static void mw_prpl_remove_group(PurpleConnection *gc, PurpleGroup *group) { |
5019 struct mwPurplePluginData *pd; | 5019 struct mwPurplePluginData *pd; |
5020 struct mwAwareList *list; | 5020 struct mwAwareList *list; |
5021 | 5021 |
5022 pd = gc->proto_data; | 5022 pd = purple_connection_get_protocol_data(gc); |
5023 g_return_if_fail(pd != NULL); | 5023 g_return_if_fail(pd != NULL); |
5024 g_return_if_fail(pd->group_list_map != NULL); | 5024 g_return_if_fail(pd->group_list_map != NULL); |
5025 | 5025 |
5026 list = g_hash_table_lookup(pd->group_list_map, group); | 5026 list = g_hash_table_lookup(pd->group_list_map, group); |
5027 | 5027 |
5041 struct mwServiceAware *srvc; | 5041 struct mwServiceAware *srvc; |
5042 PurpleAccount *acct; | 5042 PurpleAccount *acct; |
5043 | 5043 |
5044 g_return_val_if_fail(gc != NULL, FALSE); | 5044 g_return_val_if_fail(gc != NULL, FALSE); |
5045 | 5045 |
5046 pd = gc->proto_data; | 5046 pd = purple_connection_get_protocol_data(gc); |
5047 g_return_val_if_fail(pd != NULL, FALSE); | 5047 g_return_val_if_fail(pd != NULL, FALSE); |
5048 | 5048 |
5049 srvc = pd->srvc_aware; | 5049 srvc = pd->srvc_aware; |
5050 g_return_val_if_fail(srvc != NULL, FALSE); | 5050 g_return_val_if_fail(srvc != NULL, FALSE); |
5051 | 5051 |
5073 | 5073 |
5074 DEBUG_INFO("ft_outgoing_init\n"); | 5074 DEBUG_INFO("ft_outgoing_init\n"); |
5075 | 5075 |
5076 acct = purple_xfer_get_account(xfer); | 5076 acct = purple_xfer_get_account(xfer); |
5077 gc = purple_account_get_connection(acct); | 5077 gc = purple_account_get_connection(acct); |
5078 pd = gc->proto_data; | 5078 pd = purple_connection_get_protocol_data(gc); |
5079 srvc = pd->srvc_ft; | 5079 srvc = pd->srvc_ft; |
5080 | 5080 |
5081 filename = purple_xfer_get_local_filename(xfer); | 5081 filename = purple_xfer_get_local_filename(xfer); |
5082 filesize = purple_xfer_get_size(xfer); | 5082 filesize = purple_xfer_get_size(xfer); |
5083 idb.user = purple_xfer_get_remote_user(xfer); | 5083 idb.user = purple_xfer_get_remote_user(xfer); |
5532 struct mwServiceResolve *srvc; | 5532 struct mwServiceResolve *srvc; |
5533 GList *query; | 5533 GList *query; |
5534 enum mwResolveFlag flags; | 5534 enum mwResolveFlag flags; |
5535 guint32 req; | 5535 guint32 req; |
5536 | 5536 |
5537 pd = gc->proto_data; | 5537 pd = purple_connection_get_protocol_data(gc); |
5538 srvc = pd->srvc_resolve; | 5538 srvc = pd->srvc_resolve; |
5539 | 5539 |
5540 query = g_list_prepend(NULL, (char *) name); | 5540 query = g_list_prepend(NULL, (char *) name); |
5541 flags = mwResolveFlag_FIRST | mwResolveFlag_GROUPS; | 5541 flags = mwResolveFlag_FIRST | mwResolveFlag_GROUPS; |
5542 | 5542 |
5657 struct mwServiceResolve *srvc; | 5657 struct mwServiceResolve *srvc; |
5658 GList *query; | 5658 GList *query; |
5659 enum mwResolveFlag flags; | 5659 enum mwResolveFlag flags; |
5660 guint32 req; | 5660 guint32 req; |
5661 | 5661 |
5662 pd = gc->proto_data; | 5662 pd = purple_connection_get_protocol_data(gc); |
5663 srvc = pd->srvc_resolve; | 5663 srvc = pd->srvc_resolve; |
5664 | 5664 |
5665 query = g_list_prepend(NULL, (char *) name); | 5665 query = g_list_prepend(NULL, (char *) name); |
5666 flags = mwResolveFlag_FIRST | mwResolveFlag_USERS; | 5666 flags = mwResolveFlag_FIRST | mwResolveFlag_USERS; |
5667 | 5667 |