gobjectification: 8d411124: compile msnp9 too
sadrul at pidgin.im
sadrul at pidgin.im
Thu Mar 13 04:38:29 EDT 2008
-----------------------------------------------------------------
Revision: 8d4111248faf86d5741a0ddf17292050f4c44451
Ancestor: 90010b73db89147ef90a4fe400e12b1aa40d1efa
Author: sadrul at pidgin.im
Date: 2008-03-13T08:22:12
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/8d4111248faf86d5741a0ddf17292050f4c44451
Modified files:
libpurple/protocols/msnp9/dialog.c
libpurple/protocols/msnp9/msn.c
libpurple/protocols/msnp9/servconn.c
libpurple/protocols/msnp9/user.c
libpurple/protocols/msnp9/userlist.c
ChangeLog:
compile msnp9 too
-------------- next part --------------
============================================================
--- libpurple/protocols/msnp9/dialog.c 26fd6b6007228333c69f0d8e558d95a56b582a0f
+++ libpurple/protocols/msnp9/dialog.c 942343cdade4498b62ac5d170921928dc0be85ca
@@ -46,9 +46,9 @@ msn_complete_sync_issue(MsnAddRemData *d
group = purple_find_group(data->group);
if (group != NULL)
- buddy = purple_find_buddy_in_group(purple_connection_get_account(purple_account_get_connection(data)), data->who, group);
+ buddy = purple_find_buddy_in_group(purple_connection_get_account(data->gc), data->who, group);
else
- buddy = purple_find_buddy(purple_connection_get_account(purple_account_get_connection(data)), data->who);
+ buddy = purple_find_buddy(purple_connection_get_account(data->gc), data->who);
if (buddy != NULL)
purple_blist_remove_buddy(buddy);
@@ -62,7 +62,7 @@ msn_add_cb(MsnAddRemData *data)
msn_complete_sync_issue(data);
- session = purple_account_get_connection(data)->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(data->gc));
userlist = session->userlist;
msn_userlist_add_buddy(userlist, data->who, MSN_LIST_FL, data->group);
@@ -80,7 +80,7 @@ msn_rem_cb(MsnAddRemData *data)
msn_complete_sync_issue(data);
- session = purple_account_get_connection(data)->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(data->gc));
userlist = session->userlist;
msn_userlist_rem_buddy(userlist, data->who, MSN_LIST_FL, data->group);
@@ -105,7 +105,7 @@ msn_show_sync_issue(MsnSession *session,
data = g_new0(MsnAddRemData, 1);
data->who = g_strdup(passport);
data->group = g_strdup(group_name);
- purple_account_get_connection(data) = gc;
+ data->gc = gc;
msg = g_strdup_printf(_("Buddy list synchronization issue in %s (%s)"),
purple_account_get_username(account),
============================================================
--- libpurple/protocols/msnp9/msn.c 98788274d6fb36235707153691a46d71e94b3f5a
+++ libpurple/protocols/msnp9/msn.c 69c322778678745c9e423196ce631d6044f6e60b
@@ -109,7 +109,7 @@ msn_send_attention(PurpleConnection *gc,
MsnSwitchBoard *swboard;
msg = msn_message_new_nudge();
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
swboard = msn_session_get_swboard(session, username, MSN_SB_FLAG_IM);
if (swboard == NULL)
@@ -156,7 +156,7 @@ msn_act_id(PurpleConnection *gc, const c
PurpleAccount *account;
const char *alias;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
cmdproc = session->notification->cmdproc;
account = purple_connection_get_account(gc);
@@ -183,7 +183,7 @@ msn_set_prp(PurpleConnection *gc, const
MsnCmdProc *cmdproc;
MsnSession *session;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
cmdproc = session->notification->cmdproc;
if (entry == NULL || *entry == '\0')
@@ -237,7 +237,7 @@ send_to_mobile(PurpleConnection *gc, con
char *payload;
size_t payload_len;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
cmdproc = session->notification->cmdproc;
page = msn_page_new();
@@ -257,7 +257,7 @@ send_to_mobile_cb(MsnMobileData *data, c
static void
send_to_mobile_cb(MsnMobileData *data, const char *entry)
{
- send_to_mobile(purple_account_get_connection(data), data->passport, entry);
+ send_to_mobile(data->gc, data->passport, entry);
g_free(data);
}
@@ -293,7 +293,7 @@ msn_show_set_home_phone(PurplePluginActi
MsnSession *session;
gc = (PurpleConnection *) action->context;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
purple_request_input(gc, NULL, _("Set your home phone number."), NULL,
msn_user_get_home_phone(session->user), FALSE, FALSE, NULL,
@@ -310,7 +310,7 @@ msn_show_set_work_phone(PurplePluginActi
MsnSession *session;
gc = (PurpleConnection *) action->context;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
purple_request_input(gc, NULL, _("Set your work phone number."), NULL,
msn_user_get_work_phone(session->user), FALSE, FALSE, NULL,
@@ -327,7 +327,7 @@ msn_show_set_mobile_phone(PurplePluginAc
MsnSession *session;
gc = (PurpleConnection *) action->context;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
purple_request_input(gc, NULL, _("Set your mobile phone number."), NULL,
msn_user_get_mobile_phone(session->user), FALSE, FALSE, NULL,
@@ -363,7 +363,7 @@ msn_show_hotmail_inbox(PurplePluginActio
MsnSession *session;
gc = (PurpleConnection *) action->context;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
if (session->passport_info.file == NULL)
{
@@ -388,10 +388,10 @@ show_send_to_mobile_cb(PurpleBlistNode *
buddy = (PurpleBuddy *) node;
gc = purple_account_get_connection(buddy->account);
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
data = g_new0(MsnMobileData, 1);
- purple_account_get_connection(data) = gc;
+ data->gc = gc;
data->passport = buddy->name;
purple_request_input(gc, NULL, _("Send a mobile message."), NULL,
@@ -407,7 +407,7 @@ msn_offline_message(const PurpleBuddy *b
MsnUser *user;
if (buddy == NULL)
return FALSE;
- user = buddy->proto_data;
+ user = purple_object_get_protocol_data(PURPLE_OBJECT(buddy));
return user && user->mobile;
}
@@ -425,7 +425,7 @@ initiate_chat_cb(PurpleBlistNode *node,
buddy = (PurpleBuddy *) node;
gc = purple_account_get_connection(buddy->account);
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
swboard = msn_switchboard_new(session);
msn_switchboard_request(swboard);
@@ -454,7 +454,7 @@ msn_new_xfer(PurpleConnection *gc, const
MsnSlpLink *slplink;
PurpleXfer *xfer;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_SEND, who);
if (xfer)
@@ -532,7 +532,7 @@ msn_tooltip_text(PurpleBuddy *buddy, Pur
PurplePresence *presence = purple_buddy_get_presence(buddy);
PurpleStatus *status = purple_presence_get_active_status(presence);
- user = buddy->proto_data;
+ user = purple_object_get_protocol_data(PURPLE_OBJECT(buddy));
if (purple_presence_is_online(presence))
@@ -684,7 +684,7 @@ msn_buddy_menu(PurpleBuddy *buddy)
g_return_val_if_fail(buddy != NULL, NULL);
- user = buddy->proto_data;
+ user = purple_object_get_protocol_data(PURPLE_OBJECT(buddy));
if (user != NULL)
{
@@ -754,8 +754,8 @@ msn_login(PurpleAccount *account)
session = msn_session_new(account);
- gc->proto_data = session;
- gc->flags |= PURPLE_CONNECTION_FLAGS_HTML | PURPLE_CONNECTION_FLAGS_FORMATTING_WBFO | PURPLE_CONNECTION_FLAGS_NO_BGCOLOR | PURPLE_CONNECTION_FLAGS_NO_FONTSIZE | PURPLE_CONNECTION_FLAGS_NO_URLDESC;
+ purple_object_set_protocol_data(PURPLE_OBJECT(gc),session);
+ purple_connection_turn_on_flags(gc, PURPLE_CONNECTION_FLAGS_HTML | PURPLE_CONNECTION_FLAGS_FORMATTING_WBFO | PURPLE_CONNECTION_FLAGS_NO_BGCOLOR | PURPLE_CONNECTION_FLAGS_NO_FONTSIZE | PURPLE_CONNECTION_FLAGS_NO_URLDESC);
msn_session_set_login_step(session, MSN_LOGIN_STEP_START);
@@ -777,20 +777,20 @@ msn_close(PurpleConnection *gc)
{
MsnSession *session;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
g_return_if_fail(session != NULL);
msn_session_destroy(session);
- gc->proto_data = NULL;
+ purple_object_set_protocol_data(PURPLE_OBJECT(gc),NULL);
}
static gboolean
msn_send_me_im(gpointer data)
{
MsnIMData *imdata = data;
- serv_got_im(purple_account_get_connection(imdata), imdata->who, imdata->msg, imdata->flags, imdata->when);
+ serv_got_im(imdata->gc, imdata->who, imdata->msg, imdata->flags, imdata->when);
g_free(imdata->msg);
g_free(imdata);
return FALSE;
@@ -839,7 +839,7 @@ msn_send_im(PurpleConnection *gc, const
MsnSession *session;
MsnSwitchBoard *swboard;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
swboard = msn_session_get_swboard(session, who, MSN_SB_FLAG_IM);
msn_switchboard_send_msg(swboard, msg, TRUE);
@@ -866,7 +866,7 @@ msn_send_im(PurpleConnection *gc, const
g_free(post);
serv_got_typing_stopped(gc, who);
- purple_account_get_connection(imdata) = gc;
+ imdata->gc = gc;
imdata->who = who;
imdata->msg = body_str;
imdata->flags = flags;
@@ -888,7 +888,7 @@ msn_send_typing(PurpleConnection *gc, co
MsnMessage *msg;
account = purple_connection_get_account(gc);
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
/*
* TODO: I feel like this should be "if (state != PURPLE_TYPING)"
@@ -937,7 +937,7 @@ msn_set_status(PurpleAccount *account, P
if (gc != NULL)
{
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
msn_change_status(session);
}
}
@@ -947,7 +947,7 @@ msn_set_idle(PurpleConnection *gc, int i
{
MsnSession *session;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
msn_change_status(session);
}
@@ -1009,7 +1009,7 @@ msn_add_buddy(PurpleConnection *gc, Purp
MsnUserList *userlist;
const char *who;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
userlist = session->userlist;
who = msn_normalize(purple_connection_get_account(gc), buddy->name);
@@ -1056,7 +1056,7 @@ msn_rem_buddy(PurpleConnection *gc, Purp
MsnSession *session;
MsnUserList *userlist;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
userlist = session->userlist;
if (!session->logged_in)
@@ -1073,7 +1073,7 @@ msn_add_permit(PurpleConnection *gc, con
MsnUserList *userlist;
MsnUser *user;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
userlist = session->userlist;
user = msn_userlist_find_user(userlist, who);
@@ -1093,7 +1093,7 @@ msn_add_deny(PurpleConnection *gc, const
MsnUserList *userlist;
MsnUser *user;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
userlist = session->userlist;
user = msn_userlist_find_user(userlist, who);
@@ -1113,7 +1113,7 @@ msn_rem_permit(PurpleConnection *gc, con
MsnUserList *userlist;
MsnUser *user;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
userlist = session->userlist;
if (!session->logged_in)
@@ -1134,7 +1134,7 @@ msn_rem_deny(PurpleConnection *gc, const
MsnUserList *userlist;
MsnUser *user;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
userlist = session->userlist;
if (!session->logged_in)
@@ -1156,7 +1156,7 @@ msn_set_permit_deny(PurpleConnection *gc
MsnCmdProc *cmdproc;
account = purple_connection_get_account(gc);
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
cmdproc = session->notification->cmdproc;
if (account->perm_deny == PURPLE_PRIVACY_ALLOW_ALL ||
@@ -1177,7 +1177,7 @@ msn_chat_invite(PurpleConnection *gc, in
MsnSession *session;
MsnSwitchBoard *swboard;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
swboard = msn_session_find_swboard_with_id(session, id);
@@ -1202,7 +1202,7 @@ msn_chat_leave(PurpleConnection *gc, int
MsnSwitchBoard *swboard;
PurpleConversation *conv;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
swboard = msn_session_find_swboard_with_id(session, id);
@@ -1234,7 +1234,7 @@ msn_chat_send(PurpleConnection *gc, int
char *msgtext;
account = purple_connection_get_account(gc);
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
swboard = msn_session_find_swboard_with_id(session, id);
if (swboard == NULL)
@@ -1274,7 +1274,7 @@ msn_keepalive(PurpleConnection *gc)
{
MsnSession *session;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
if (!session->http_method)
{
@@ -1293,7 +1293,7 @@ msn_group_buddy(PurpleConnection *gc, co
MsnSession *session;
MsnUserList *userlist;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
userlist = session->userlist;
msn_userlist_move_buddy(userlist, who, old_group_name, new_group_name);
@@ -1308,7 +1308,7 @@ msn_rename_group(PurpleConnection *gc, c
int old_gid;
const char *enc_new_group_name;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
cmdproc = session->notification->cmdproc;
enc_new_group_name = purple_url_encode(group->name);
@@ -1332,7 +1332,7 @@ msn_convo_closed(PurpleConnection *gc, c
MsnSwitchBoard *swboard;
PurpleConversation *conv;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
swboard = msn_session_find_swboard(session, who);
@@ -1368,7 +1368,7 @@ msn_set_buddy_icon(PurpleConnection *gc,
MsnSession *session;
MsnUser *user;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
user = session->user;
msn_user_set_buddy_icon(user, img);
@@ -1383,7 +1383,7 @@ msn_remove_group(PurpleConnection *gc, P
MsnCmdProc *cmdproc;
int group_id;
- session = gc->proto_data;
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
cmdproc = session->notification->cmdproc;
if ((group_id = msn_userlist_find_group_id(session->userlist, group->name)) >= 0)
@@ -1400,7 +1400,7 @@ msn_tooltip_extract_info_text(PurpleNoti
{
PurpleBuddy *b;
- b = purple_find_buddy(purple_connection_get_account(info_purple_account_get_connection(data)),
+ b = purple_find_buddy(purple_connection_get_account(info_data->gc),
info_data->name);
if (b)
@@ -1414,9 +1414,9 @@ msn_tooltip_extract_info_text(PurpleNoti
g_free(aliastext);
}
- if (purple_buddy_get_server_alias(b))
+ if (b->server_alias)
{
- char *nicktext = g_markup_escape_text(purple_buddy_get_server_alias(b), -1);
+ char *nicktext = g_markup_escape_text(b->server_alias, -1);
tmp = g_strdup_printf("<font sml=\"msn\">%s</font><br>", nicktext);
purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp);
g_free(tmp);
@@ -1511,7 +1511,7 @@ msn_got_info(PurpleUtilFetchUrlData *url
purple_debug_info("msn", "In msn_got_info\n");
/* Make sure the connection is still valid */
- if (g_list_find(purple_connections_get_all(), info_purple_account_get_connection(data)) == NULL)
+ if (g_list_find(purple_connections_get_all(), info_data->gc) == NULL)
{
purple_debug_warning("msn", "invalid connection. ignoring buddy info.\n");
g_free(info_data->name);
@@ -1528,7 +1528,7 @@ msn_got_info(PurpleUtilFetchUrlData *url
purple_notify_user_info_add_pair(user_info, NULL, tmp);
g_free(tmp);
- purple_notify_userinfo(info_purple_account_get_connection(data), info_data->name, user_info, NULL, NULL);
+ purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL);
purple_notify_user_info_destroy(user_info);
g_free(info_data->name);
@@ -1866,7 +1866,7 @@ msn_got_info(PurpleUtilFetchUrlData *url
* Let's see how long this one holds out for ... */
char *p = strstr(url_buffer, "<form id=\"profile_form\" name=\"profile_form\" action=\"http://spaces.live.com/profile.aspx?cid=0\"");
PurpleBuddy *b = purple_find_buddy
- (purple_connection_get_account(info_purple_account_get_connection(data)), info_data->name);
+ (purple_connection_get_account(info_data->gc), info_data->name);
purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"),
((p && b) ? _("The user has not created a public profile.") :
(p ? _("MSN reported not being able to find the user's profile. "
@@ -1926,7 +1926,7 @@ msn_got_photo(PurpleUtilFetchUrlData *ur
/* Make sure the connection is still valid if we got here by fetching a photo url */
if (url_text && (error_message != NULL ||
- g_list_find(purple_connections_get_all(), info_purple_account_get_connection(data)) == NULL))
+ g_list_find(purple_connections_get_all(), info_data->gc) == NULL))
{
purple_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n");
g_free(stripped);
@@ -1963,7 +1963,7 @@ msn_got_photo(PurpleUtilFetchUrlData *ur
/* We continue here from msn_got_info, as if nothing has happened */
#endif
- purple_notify_userinfo(info_purple_account_get_connection(data), info_data->name, user_info, NULL, NULL);
+ purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL);
g_free(stripped);
g_free(url_buffer);
@@ -1985,7 +1985,7 @@ msn_get_info(PurpleConnection *gc, const
char *url;
data = g_new0(MsnGetInfoData, 1);
- purple_account_get_connection(data) = gc;
+ data->gc = gc;
data->name = g_strdup(name);
url = g_strdup_printf("%s%s", PROFILE_URL, name);
============================================================
--- libpurple/protocols/msnp9/servconn.c e18d80f139fc60b4cfea7ec17cd785d148f952fc
+++ libpurple/protocols/msnp9/servconn.c 8fdb48f52d23a17e27acad6dbb8c8f7385b23877
@@ -387,7 +387,10 @@ read_cb(gpointer data, gint source, Purp
session = servconn->session;
len = read(servconn->fd, buf, sizeof(buf) - 1);
+#warning FIXME: uncomment!!
+#if 0
purple_account_get_connection(servconn->session->account)->last_received = time(NULL);
+#endif
if (len < 0 && errno == EAGAIN)
return;
============================================================
--- libpurple/protocols/msnp9/user.c 3f529cb37240ef84f4032a6c71910367c1d488f8
+++ libpurple/protocols/msnp9/user.c e33de1bcd9385b13c5ec438cd9e9b653f485559f
@@ -257,7 +257,7 @@ msn_user_add_group_id(MsnUser *user, int
purple_blist_add_buddy(b, NULL, g, NULL);
}
- b->proto_data = user;
+ purple_object_set_protocol_data(PURPLE_OBJECT(b),user);
}
void
============================================================
--- libpurple/protocols/msnp9/userlist.c c464bf6cc35b5ba53026f14082a0e02d978981a2
+++ libpurple/protocols/msnp9/userlist.c e9a4ed75341485f9bf4710d24da1d77aa9f6d112
@@ -44,8 +44,8 @@ msn_accept_add_cb(gpointer data)
MsnSession *session;
MsnUserList *userlist;
- if (PURPLE_CONNECTION_IS_VALID(purple_account_get_connection(pa))) {
- session = purple_account_get_connection(pa)->proto_data;
+ if (PURPLE_CONNECTION_IS_VALID(pa->gc)) {
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(pa->gc));
userlist = session->userlist;
msn_userlist_add_buddy(userlist, pa->who, MSN_LIST_AL, NULL);
@@ -63,8 +63,8 @@ msn_cancel_add_cb(gpointer data)
MsnSession *session;
MsnUserList *userlist;
- if (PURPLE_CONNECTION_IS_VALID(purple_account_get_connection(pa))) {
- session = purple_account_get_connection(pa)->proto_data;
+ if (PURPLE_CONNECTION_IS_VALID(pa->gc)) {
+ session = purple_object_get_protocol_data(PURPLE_OBJECT(pa->gc));
userlist = session->userlist;
msn_userlist_add_buddy(userlist, pa->who, MSN_LIST_BL, NULL);
@@ -83,7 +83,7 @@ got_new_entry(PurpleConnection *gc, cons
pa = g_new0(MsnPermitAdd, 1);
pa->who = g_strdup(passport);
pa->friendly = g_strdup(friendly);
- purple_account_get_connection(pa) = gc;
+ pa->gc = gc;
purple_account_request_authorization(purple_connection_get_account(gc), passport, NULL, friendly, NULL,
purple_find_buddy(purple_connection_get_account(gc), passport) != NULL,
More information about the Commits
mailing list