pidgin: 26f34e91: More code changed to use the accessor fu...
andrew.victor at mxit.com
andrew.victor at mxit.com
Sat Oct 1 12:31:53 EDT 2011
----------------------------------------------------------------------
Revision: 26f34e91897b37c04c5520e69194fd33268009aa
Parent: 5f62738a1aa375e5c0f5bb9d9253b73dda1f4ce4
Author: andrew.victor at mxit.com
Date: 10/01/11 11:50:20
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/26f34e91897b37c04c5520e69194fd33268009aa
Changelog:
More code changed to use the accessor functions.
Changes against parent 5f62738a1aa375e5c0f5bb9d9253b73dda1f4ce4
patched libpurple/plugins/statenotify.c
patched libpurple/status.c
patched pidgin/gtkblist.c
patched pidgin/gtkconv.c
patched pidgin/plugins/adiumthemes/webkit.c
patched pidgin/plugins/musicmessaging/musicmessaging.c
-------------- next part --------------
============================================================
--- pidgin/gtkconv.c 55f06c1a76c7f55c03bb03f6a69ce3e4ea381c4f
+++ pidgin/gtkconv.c e08b9a4db7f235614197b23db863d34f73b54f7d
@@ -235,15 +235,16 @@ get_conversation_blist_node(PurpleConver
static PurpleBlistNode *
get_conversation_blist_node(PurpleConversation *conv)
{
+ PurpleAccount *account = purple_conversation_get_account(conv);
PurpleBlistNode *node = NULL;
switch (purple_conversation_get_type(conv)) {
case PURPLE_CONV_TYPE_IM:
- node = PURPLE_BLIST_NODE(purple_find_buddy(conv->account, conv->name));
+ node = PURPLE_BLIST_NODE(purple_find_buddy(account, purple_conversation_get_name(conv)));
node = node ? node->parent : NULL;
break;
case PURPLE_CONV_TYPE_CHAT:
- node = PURPLE_BLIST_NODE(purple_blist_find_chat(conv->account, conv->name));
+ node = PURPLE_BLIST_NODE(purple_blist_find_chat(account, purple_conversation_get_name(conv)));
break;
default:
break;
@@ -315,7 +316,7 @@ default_formatize(PidginConversation *c)
default_formatize(PidginConversation *c)
{
PurpleConversation *conv = c->active_conv;
- gtk_imhtml_setup_entry(GTK_IMHTML(c->entry), conv->features);
+ gtk_imhtml_setup_entry(GTK_IMHTML(c->entry), purple_conversation_get_features(conv));
}
static void
@@ -655,7 +656,7 @@ send_cb(GtkWidget *widget, PidginConvers
flags |= PURPLE_MESSAGE_IMAGES;
gc = purple_account_get_connection(account);
- if (gc && (conv->features & PURPLE_CONNECTION_NO_NEWLINES)) {
+ if (gc && (purple_conversation_get_features(conv) & PURPLE_CONNECTION_NO_NEWLINES)) {
char **bufs;
int i;
@@ -1092,7 +1093,7 @@ menu_save_as_cb(gpointer data, guint act
{
PidginWindow *win = data;
PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
- PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+ PurpleBuddy *buddy = purple_find_buddy(conv->account, purple_conversation_get_name(conv));
const char *name;
gchar *buf;
gchar *c;
@@ -1100,7 +1101,7 @@ menu_save_as_cb(gpointer data, guint act
if (buddy != NULL)
name = purple_buddy_get_contact_alias(buddy);
else
- name = purple_normalize(conv->account, conv->name);
+ name = purple_normalize(conv->account, purple_conversation_get_name(conv));
buf = g_strdup_printf("%s.html", name);
for (c = buf ; *c ; c++)
@@ -1440,7 +1441,7 @@ menu_logging_cb(gpointer data, guint act
}
/* Save the setting IFF it's different than the pref. */
- switch (conv->type)
+ switch (purple_conversation_get_type(conv))
{
case PURPLE_CONV_TYPE_IM:
if (logging == purple_prefs_get_bool("/purple/logging/log_ims"))
@@ -2304,10 +2305,10 @@ pidgin_conv_switch_active_conversation(P
gtk_imhtml_set_protocol_name(entry, protocol_name);
/* TODO WEBKIT: gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml), protocol_name); */
- if (!(conv->features & PURPLE_CONNECTION_HTML))
+ if (!(purple_conversation_get_features(conv) & PURPLE_CONNECTION_HTML))
gtk_imhtml_clear_formatting(GTK_IMHTML(gtkconv->entry));
- else if (conv->features & PURPLE_CONNECTION_FORMATTING_WBFO &&
- !(old_conv->features & PURPLE_CONNECTION_FORMATTING_WBFO))
+ else if (purple_conversation_get_features(conv) & PURPLE_CONNECTION_FORMATTING_WBFO &&
+ !(purple_conversation_get_features(old_conv) & PURPLE_CONNECTION_FORMATTING_WBFO))
{
/* The old conversation allowed formatting on parts of the
* buffer, but the new one only allows it on the whole
@@ -2347,12 +2348,12 @@ pidgin_conv_switch_active_conversation(P
gtk_imhtml_toggle_fontface(entry, fontface);
- if (!(conv->features & PURPLE_CONNECTION_NO_FONTSIZE))
+ if (!(purple_conversation_get_features(conv) & PURPLE_CONNECTION_NO_FONTSIZE))
gtk_imhtml_font_set_size(entry, fontsize);
gtk_imhtml_toggle_forecolor(entry, forecolor);
- if (!(conv->features & PURPLE_CONNECTION_NO_BGCOLOR))
+ if (!(purple_conversation_get_features(conv) & PURPLE_CONNECTION_NO_BGCOLOR))
{
gtk_imhtml_toggle_backcolor(entry, backcolor);
gtk_imhtml_toggle_background(entry, background);
@@ -2370,7 +2371,7 @@ pidgin_conv_switch_active_conversation(P
* here, we didn't call gtk_imhtml_clear_formatting() (because we want to
* preserve the formatting exactly as it is), so we have to do this now. */
gtk_imhtml_set_whole_buffer_formatting_only(entry,
- (conv->features & PURPLE_CONNECTION_FORMATTING_WBFO));
+ (purple_conversation_get_features(conv) & PURPLE_CONNECTION_FORMATTING_WBFO));
}
purple_signal_emit(pidgin_conversations_get_handle(), "conversation-switched", conv);
@@ -2600,7 +2601,7 @@ update_tab_icon(PurpleConversation *conv
status = infopane_status = pidgin_conv_get_icon_stock(conv);
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
- PurpleBuddy *b = purple_find_buddy(conv->account, conv->name);
+ PurpleBuddy *b = purple_find_buddy(conv->account, purple_conversation_get_name(conv));
if (b)
emblem = pidgin_blist_get_emblem((PurpleBlistNode*)b);
}
@@ -2884,7 +2885,7 @@ icon_menu_save_cb(GtkWidget *widget, Pid
ext = purple_buddy_icon_get_extension(purple_conv_im_get_icon(PURPLE_CONV_IM(conv)));
- buf = g_strdup_printf("%s.%s", purple_normalize(conv->account, conv->name), ext);
+ buf = g_strdup_printf("%s.%s", purple_normalize(conv->account, purple_conversation_get_name(conv)), ext);
purple_request_file(gtkconv, _("Save Icon"), buf, TRUE,
G_CALLBACK(saveicon_writefile_cb), NULL,
@@ -3236,7 +3237,7 @@ populate_menu_with_options(GtkWidget *me
conv = gtkconv->active_conv;
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
- chat = purple_blist_find_chat(conv->account, conv->name);
+ chat = purple_blist_find_chat(conv->account, purple_conversation_get_name(conv));
if ((chat == NULL) && (gtkconv->webview != NULL)) {
chat = g_object_get_data(G_OBJECT(gtkconv->webview), "transient_chat");
@@ -3267,7 +3268,7 @@ populate_menu_with_options(GtkWidget *me
if (!purple_account_is_connected(conv->account))
return FALSE;
- buddy = purple_find_buddy(conv->account, conv->name);
+ buddy = purple_find_buddy(conv->account, purple_conversation_get_name(conv));
/* gotta remain bug-compatible :( libpurple < 2.0.2 didn't handle
* removing "isolated" buddy nodes well */
@@ -3277,7 +3278,7 @@ populate_menu_with_options(GtkWidget *me
}
if ((buddy == NULL) && (gtkconv->webview != NULL)) {
- buddy = purple_buddy_new(conv->account, conv->name, NULL);
+ buddy = purple_buddy_new(conv->account, purple_conversation_get_name(conv), NULL);
purple_blist_node_set_flags((PurpleBlistNode *)buddy,
PURPLE_BLIST_NODE_FLAG_NO_SAVE);
g_object_set_data_full(G_OBJECT(gtkconv->webview), "transient_buddy",
@@ -3782,7 +3783,7 @@ update_send_to_selection(PidginWindow *w
if (win->menu.send_to == NULL)
return FALSE;
- if (!(b = purple_find_buddy(account, conv->name)))
+ if (!(b = purple_find_buddy(account, purple_conversation_get_name(conv))))
return FALSE;
@@ -3942,7 +3943,7 @@ generate_send_to_items(PidginWindow *win
gtk_widget_show(menu);
- if (gtkconv->active_conv->type == PURPLE_CONV_TYPE_IM) {
+ if (purple_conversation_get_type(gtkconv->active_conv) == PURPLE_CONV_TYPE_IM) {
buds = purple_find_buddies(gtkconv->active_conv->account, gtkconv->active_conv->name);
if (buds == NULL)
@@ -4890,11 +4891,11 @@ pidgin_conv_create_tooltip(GtkWidget *ti
conv = gtkconv->active_conv;
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
- node = (PurpleBlistNode*)(purple_blist_find_chat(conv->account, conv->name));
+ node = (PurpleBlistNode*)(purple_blist_find_chat(conv->account, purple_conversation_get_name(conv)));
if (!node)
node = g_object_get_data(G_OBJECT(gtkconv->webview), "transient_chat");
} else {
- node = (PurpleBlistNode*)(purple_find_buddy(conv->account, conv->name));
+ node = (PurpleBlistNode*)(purple_find_buddy(conv->account, purple_conversation_get_name(conv)));
#if 0
/* Using the transient blist nodes to show the tooltip doesn't quite work yet. */
if (!node)
@@ -4992,7 +4993,7 @@ replace_header_tokens(PurpleConversation
const char *fin = NULL;
if (g_str_has_prefix(cur, "%chatName%")) {
- replace = conv->name;
+ replace = purple_conversation_get_name(conv);
} else if (g_str_has_prefix(cur, "%sourceName%")) {
replace = purple_account_get_alias(conv->account);
@@ -5000,11 +5001,11 @@ replace_header_tokens(PurpleConversation
replace = purple_account_get_username(conv->account);
} else if (g_str_has_prefix(cur, "%destinationName%")) {
- PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+ PurpleBuddy *buddy = purple_find_buddy(conv->account, purple_conversation_get_name(conv));
if (buddy) {
replace = purple_buddy_get_alias(buddy);
} else {
- replace = conv->name;
+ replace = purple_conversation_get_name(conv);
}
} else if (g_str_has_prefix(cur, "%incomingIconPath%")) {
@@ -5133,7 +5134,7 @@ setup_common_pane(PidginConversation *gt
GtkTreePath *path;
PurpleConversation *conv = gtkconv->active_conv;
PurpleBuddy *buddy;
- gboolean chat = (conv->type == PURPLE_CONV_TYPE_CHAT);
+ gboolean chat = (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT);
int buddyicon_size = 0;
char *header, *footer;
char *template;
@@ -5467,7 +5468,7 @@ pidgin_conv_find_gtkconv(PurpleConversat
static PidginConversation *
pidgin_conv_find_gtkconv(PurpleConversation * conv)
{
- PurpleBuddy *bud = purple_find_buddy(conv->account, conv->name);
+ PurpleBuddy *bud = purple_find_buddy(conv->account, purple_conversation_get_name(conv));
PurpleContact *c;
PurpleBlistNode *cn, *bn;
@@ -5689,7 +5690,7 @@ private_gtkconv_new(PurpleConversation *
nick_colors = generate_nick_colors(&nbr_nick_colors, gtk_widget_get_style(gtkconv->webview)->base[GTK_STATE_NORMAL]);
}
- if (conv->features & PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY)
+ if (purple_conversation_get_features(conv) & PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY)
pidgin_themes_smiley_themeize_custom(gtkconv->entry);
}
@@ -6269,7 +6270,7 @@ pidgin_conv_write_conv(PurpleConversatio
gtk_font_options |= GTK_IMHTML_USE_POINTSIZE;
}
- if (!(flags & PURPLE_MESSAGE_RECV) && (conv->features & PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY))
+ if (!(flags & PURPLE_MESSAGE_RECV) && (purple_conversation_get_features(conv) & PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY))
{
/* We want to see our own smileys. Need to revert it after send*/
pidgin_themes_smiley_themeize_custom(gtkconv->webview);
@@ -6431,7 +6432,7 @@ pidgin_conv_write_conv(PurpleConversatio
}
#if 0
- if (!(flags & PURPLE_MESSAGE_RECV) && (conv->features & PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY))
+ if (!(flags & PURPLE_MESSAGE_RECV) && (purple_conversation_get_features(conv) & PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY))
{
/* Restore the smiley-data */
pidgin_themes_smiley_themeize(gtkconv->webview);
@@ -6920,29 +6921,29 @@ gray_stuff_out(PidginConversation *gtkco
{
/* Account is online */
/* Deal with the toolbar */
- if (conv->features & PURPLE_CONNECTION_HTML)
+ if (purple_conversation_get_features(conv) & PURPLE_CONNECTION_HTML)
{
buttons = GTK_IMHTML_ALL; /* Everything on */
- if (conv->features & PURPLE_CONNECTION_NO_BGCOLOR)
+ if (purple_conversation_get_features(conv) & PURPLE_CONNECTION_NO_BGCOLOR)
buttons &= ~GTK_IMHTML_BACKCOLOR;
- if (conv->features & PURPLE_CONNECTION_NO_FONTSIZE)
+ if (purple_conversation_get_features(conv) & PURPLE_CONNECTION_NO_FONTSIZE)
{
buttons &= ~GTK_IMHTML_GROW;
buttons &= ~GTK_IMHTML_SHRINK;
}
- if (conv->features & PURPLE_CONNECTION_NO_URLDESC)
+ if (purple_conversation_get_features(conv) & PURPLE_CONNECTION_NO_URLDESC)
buttons &= ~GTK_IMHTML_LINKDESC;
} else {
buttons = GTK_IMHTML_SMILEY | GTK_IMHTML_IMAGE;
}
if (!(prpl_info->options & OPT_PROTO_IM_IMAGE))
- conv->features |= PURPLE_CONNECTION_NO_IMAGES;
+ purple_conversation_set_features(conv, purple_conversation_get_features(conv) | PURPLE_CONNECTION_NO_IMAGES);
- if(conv->features & PURPLE_CONNECTION_NO_IMAGES)
+ if(purple_conversation_get_features(conv) & PURPLE_CONNECTION_NO_IMAGES)
buttons &= ~GTK_IMHTML_IMAGE;
- if (conv->features & PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY)
+ if (purple_conversation_get_features(conv) & PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY)
buttons |= GTK_IMHTML_CUSTOM_SMILEY;
else
buttons &= ~GTK_IMHTML_CUSTOM_SMILEY;
@@ -6956,8 +6957,8 @@ gray_stuff_out(PidginConversation *gtkco
gtk_widget_set_sensitive(win->menu.add_pounce, TRUE);
gtk_widget_set_sensitive(win->menu.get_info, (prpl_info->get_info != NULL));
gtk_widget_set_sensitive(win->menu.invite, (prpl_info->chat_invite != NULL));
- gtk_widget_set_sensitive(win->menu.insert_link, (conv->features & PURPLE_CONNECTION_HTML));
- gtk_widget_set_sensitive(win->menu.insert_image, !(conv->features & PURPLE_CONNECTION_NO_IMAGES));
+ gtk_widget_set_sensitive(win->menu.insert_link, (purple_conversation_get_features(conv) & PURPLE_CONNECTION_HTML));
+ gtk_widget_set_sensitive(win->menu.insert_image, !(purple_conversation_get_features(conv) & PURPLE_CONNECTION_NO_IMAGES));
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
{
@@ -7008,7 +7009,7 @@ gray_stuff_out(PidginConversation *gtkco
if ((purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) &&
(gtkconv->u.im->anim))
{
- PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+ PurpleBuddy *buddy = purple_find_buddy(conv->account, purple_conversation_get_name(conv));
window_icon =
gdk_pixbuf_animation_get_static_image(gtkconv->u.im->anim);
@@ -7111,7 +7112,7 @@ pidgin_conv_update_fields(PurpleConversa
title = g_strdup(purple_conversation_get_title(conv));
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
- buddy = purple_find_buddy(account, conv->name);
+ buddy = purple_find_buddy(account, purple_conversation_get_name(conv));
if (buddy) {
markup = pidgin_blist_get_name_markup(buddy, FALSE, FALSE);
} else {
@@ -7156,7 +7157,7 @@ pidgin_conv_update_fields(PurpleConversa
style = "tab-label-attention";
} else if (gtkconv->unseen_state == PIDGIN_UNSEEN_TEXT) {
atk_object_set_description(accessibility_obj, _("Unread Messages"));
- if (gtkconv->active_conv->type == PURPLE_CONV_TYPE_CHAT)
+ if (purple_conversation_get_type(gtkconv->active_conv) == PURPLE_CONV_TYPE_CHAT)
style = "tab-label-unreadchat";
else
style = "tab-label-attention";
@@ -7834,7 +7835,7 @@ hide_new_pref_cb(const char *name, Purpl
conv = gtkconv->active_conv;
- if (conv->type == PURPLE_CONV_TYPE_CHAT ||
+ if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT ||
gtkconv->unseen_count == 0 ||
(when_away && !purple_status_is_available(
purple_account_get_active_status(
@@ -7899,14 +7900,14 @@ account_signed_off_cb(PurpleConnection *
PIDGIN_CONV_MENU | PIDGIN_CONV_COLORIZE_TITLE);
if (PURPLE_CONNECTION_IS_CONNECTED(gc) &&
- conv->type == PURPLE_CONV_TYPE_CHAT &&
+ purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
conv->account == gc->account &&
purple_conversation_get_data(conv, "want-to-rejoin")) {
GHashTable *comps = NULL;
- PurpleChat *chat = purple_blist_find_chat(conv->account, conv->name);
+ PurpleChat *chat = purple_blist_find_chat(conv->account, purple_conversation_get_name(conv));
if (chat == NULL) {
if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL)
- comps = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, conv->name);
+ comps = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, purple_conversation_get_name(conv));
} else {
comps = chat->components;
}
@@ -8061,7 +8062,7 @@ add_message_history_to_gtkconv(gpointer
int count = 0;
int timer = gtkconv->attach.timer;
time_t when = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->entry), "attach-start-time"));
- gboolean im = (gtkconv->active_conv->type == PURPLE_CONV_TYPE_IM);
+ gboolean im = (purple_conversation_get_type(gtkconv->active_conv) == PURPLE_CONV_TYPE_IM);
gtkconv->attach.timer = 0;
while (gtkconv->attach.current && count < 100) { /* XXX: 100 is a random value here */
@@ -8185,7 +8186,7 @@ gboolean pidgin_conv_attach_to_conversat
"conversation-displayed", gtkconv);
}
- if (conv->type == PURPLE_CONV_TYPE_CHAT) {
+ if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
pidgin_conv_update_fields(conv, PIDGIN_CONV_TOPIC);
pidgin_conv_chat_add_users(conv, purple_conv_chat_get_users(PURPLE_CONV_CHAT(conv)), TRUE);
}
@@ -9389,7 +9390,7 @@ infopane_entry_activate(PidginConversati
}
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
- PurpleBuddy *buddy = purple_find_buddy(gtkconv->active_conv->account, gtkconv->active_conv->name);
+ PurpleBuddy *buddy = purple_find_buddy(gtkconv->active_conv->account, purple_conversation_get_name(gtkconv->active_conv));
if (!buddy)
/* This buddy isn't in your buddy list, so we can't alias him */
return FALSE;
============================================================
--- pidgin/gtkblist.c 4a6a7d8adc02f3a70a24f6381443bc79f9319e99
+++ pidgin/gtkblist.c 3b908cf961e761643197cc60827add394d508630
@@ -4590,6 +4590,7 @@ conversation_updated_cb(PurpleConversati
conversation_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type,
PidginBuddyList *gtkblist)
{
+ PurpleAccount *account = purple_conversation_get_account(conv);
GList *convs = NULL;
GList *ims, *chats;
GList *l = NULL;
@@ -4597,8 +4598,8 @@ conversation_updated_cb(PurpleConversati
if (type != PURPLE_CONV_UPDATE_UNSEEN)
return;
- if(conv->account != NULL && conv->name != NULL) {
- PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+ if(account != NULL && purple_conversation_get_name(conv) != NULL) {
+ PurpleBuddy *buddy = purple_find_buddy(account, purple_conversation_get_name(conv));
if(buddy != NULL)
pidgin_blist_update_buddy(NULL, (PurpleBlistNode *)buddy, TRUE);
}
@@ -4707,10 +4708,12 @@ conversation_created_cb(PurpleConversati
static void
conversation_created_cb(PurpleConversation *conv, PidginBuddyList *gtkblist)
{
- switch (conv->type) {
+ PurpleAccount *account = purple_conversation_get_account(conv);
+
+ switch (purple_conversation_get_type(conv)) {
case PURPLE_CONV_TYPE_IM:
{
- GSList *buddies = purple_find_buddies(conv->account, conv->name);
+ GSList *buddies = purple_find_buddies(account, purple_conversation_get_name(conv));
while (buddies) {
PurpleBlistNode *buddy = buddies->data;
struct _pidgin_blist_node *ui = buddy->ui_data;
@@ -4731,7 +4734,7 @@ conversation_created_cb(PurpleConversati
break;
case PURPLE_CONV_TYPE_CHAT:
{
- PurpleChat *chat = purple_blist_find_chat(conv->account, conv->name);
+ PurpleChat *chat = purple_blist_find_chat(account, purple_conversation_get_name(conv));
struct _pidgin_blist_node *ui;
if (!chat)
break;
============================================================
--- libpurple/plugins/statenotify.c 0591e135302fe74a6dbc41a26cad767a2d6431e8
+++ libpurple/plugins/statenotify.c 706fda00f11db595cb3caac1a0f8835c4ebd9300
@@ -42,7 +42,7 @@ write_status(PurpleBuddy *buddy, const c
g_snprintf(buf, sizeof(buf), message, escaped);
g_free(escaped);
- purple_conv_im_write(conv->u.im, NULL, buf, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY | PURPLE_MESSAGE_NO_LINKIFY, time(NULL));
+ purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, buf, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY | PURPLE_MESSAGE_NO_LINKIFY, time(NULL));
}
static void
============================================================
--- libpurple/status.c 4a511c4c47f7110c4cc9f9139afc8c5baf6f73c3
+++ libpurple/status.c e584a97b248cc677d75510612369b18e5cd95af2
@@ -1099,7 +1099,7 @@ purple_presence_new_for_conv(PurpleConve
presence = purple_presence_new(PURPLE_PRESENCE_CONTEXT_CONV);
presence->u.chat.conv = conv;
- /* presence->statuses = purple_prpl_get_statuses(conv->account, presence); ? */
+ /* presence->statuses = purple_prpl_get_statuses(purple_conversation_get_account(conv), presence); ? */
return presence;
}
============================================================
--- pidgin/plugins/musicmessaging/musicmessaging.c 5197d9c886e489e77e4ef4f2ff763aec3a1198cd
+++ pidgin/plugins/musicmessaging/musicmessaging.c 9d0f69ad3189f27bc1bc7386f9fe4339e5837722
@@ -104,7 +104,7 @@ void music_messaging_change_request(cons
{
if (mmconv->originator)
{
- char *name = (mmconv->conv)->name;
+ const char *name = purple_conversation_get_name(mmconv->conv);
send_change_request (session, name, command, parameters);
} else
{
@@ -376,7 +376,7 @@ intercept_received(PurpleAccount *accoun
if (mmconv->originator)
{
int session = mmconv_from_conv_loc(conv);
- char *id = (mmconv->conv)->name;
+ const char *id = purple_conversation_get_name(mmconv->conv);
char *command;
char *parameters;
@@ -424,7 +424,8 @@ intercept_received(PurpleAccount *accoun
command = strtok(NULL, " ");
/* char *parameters = strtok(NULL, "#"); DONT NEED PARAMETERS */
- if ((mmconv->conv)->name == id)
+ // TODO: Shouldn't this be strcmp() ?
+ if (purple_conversation_get_name(mmconv->conv) == id)
{
purple_notify_message(plugin_pointer, PURPLE_NOTIFY_MSG_ERROR,
_("Music Messaging"),
============================================================
--- pidgin/plugins/adiumthemes/webkit.c 1d17fce9fdb5c9369c1f6fc13c2706c199c3812d
+++ pidgin/plugins/adiumthemes/webkit.c 50318afff13e57181f2dc7cc02a3a1d9936c538d
@@ -102,6 +102,7 @@ replace_message_tokens(
PurpleMessageFlags flags,
time_t mtime)
{
+ PurpleAccount *account = purple_conversation_get_account(conv);
GString *str = g_string_new(NULL);
const char *cur = text;
const char *prev = cur;
@@ -129,10 +130,10 @@ replace_message_tokens(
g_free(format);
} else if (!strncmp(cur, "%userIconPath%", strlen("%userIconPath%"))) {
if (flags & PURPLE_MESSAGE_SEND) {
- if (purple_account_get_bool(conv->account, "use-global-buddyicon", TRUE)) {
+ if (purple_account_get_bool(account, "use-global-buddyicon", TRUE)) {
replace = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon");
} else {
- PurpleStoredImage *img = purple_buddy_icons_find_account_icon(conv->account);
+ PurpleStoredImage *img = purple_buddy_icons_find_account_icon(account);
replace = purple_imgstore_get_filename(img);
}
if (replace == NULL || !g_file_test(replace, G_FILE_TEST_EXISTS)) {
@@ -151,7 +152,7 @@ replace_message_tokens(
} else if (!strncmp(cur, "%sender%", strlen("%sender%"))) {
replace = alias;
} else if (!strncmp(cur, "%service%", strlen("%service%"))) {
- replace = purple_account_get_protocol_name(conv->account);
+ replace = purple_account_get_protocol_name(account);
} else {
cur++;
continue;
@@ -178,6 +179,7 @@ replace_header_tokens(char *text, Purple
static char *
replace_header_tokens(char *text, PurpleConversation *conv)
{
+ PurpleAccount *account = purple_conversation_get_account(conv);
GString *str = g_string_new(NULL);
char *cur = text;
char *prev = cur;
@@ -190,17 +192,17 @@ replace_header_tokens(char *text, Purple
char *fin = NULL;
if (!strncmp(cur, "%chatName%", strlen("%chatName%"))) {
- replace = conv->name;
+ replace = purple_conversation_get_name(conv);
} else if (!strncmp(cur, "%sourceName%", strlen("%sourceName%"))) {
- replace = purple_account_get_alias(conv->account);
+ replace = purple_account_get_alias(account);
if (replace == NULL)
- replace = purple_account_get_username(conv->account);
+ replace = purple_account_get_username(account);
} else if (!strncmp(cur, "%destinationName%", strlen("%destinationName%"))) {
- PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+ PurpleBuddy *buddy = purple_find_buddy(account, purple_conversation_get_name(conv));
if (buddy) {
replace = purple_buddy_get_alias(buddy);
} else {
- replace = conv->name;
+ replace = purple_conversation_get_name(conv);
}
} else if (!strncmp(cur, "%incomingIconPath%", strlen("%incomingIconPath%"))) {
PurpleBuddyIcon *icon = purple_conv_im_get_icon(PURPLE_CONV_IM(conv));
@@ -450,7 +452,7 @@ webkit_on_displaying_im_msg(PurpleAccoun
}
purple_conversation_set_data(conv, "webkit-lastflags", GINT_TO_POINTER(flags));
- smileyed = smiley_parse_markup(stripped, conv->account->protocol_id);
+ smileyed = smiley_parse_markup(stripped, purple_conversation_get_account(conv)->protocol_id);
msg = replace_message_tokens(message_html, conv, name, alias, smileyed, flags, mtime);
escape = gtk_webview_quote_js_string(msg);
script = g_strdup_printf("%s(%s)", func, escape);
More information about the Commits
mailing list