pidgin/pidgin

Parents ca31392953ed
Children 198bf5bc58ce
Update purple_conversations_find_* to return PurpleConversations instead of subclasses

Testing Done:
Tested a bonjour im and irc chat.

Reviewed at https://reviews.imfreedom.org/r/646/
--- a/finch/gntblist.c Mon May 17 20:32:56 2021 -0500
+++ b/finch/gntblist.c Tue May 18 02:04:53 2021 -0500
@@ -612,16 +612,16 @@
{
PurpleAccount *account = purple_chat_get_account(chat);
const char *name;
- PurpleChatConversation *conv;
+ PurpleConversation *conv;
name = purple_chat_get_name_only(chat);
conv = purple_conversations_find_chat_with_account(name, account);
- if (!conv || purple_chat_conversation_has_left(conv)) {
+ if (!conv || purple_chat_conversation_has_left(PURPLE_CHAT_CONVERSATION(conv))) {
purple_serv_join_chat(purple_account_get_connection(account),
purple_chat_get_components(chat));
} else if (conv) {
- purple_conversation_present(PURPLE_CONVERSATION(conv));
+ purple_conversation_present(conv);
}
}
@@ -916,17 +916,17 @@
if (PURPLE_IS_BUDDY(node))
{
PurpleBuddy *buddy = (PurpleBuddy *)node;
- PurpleIMConversation *im;
+ PurpleConversation *im;
im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy),
purple_buddy_get_account(buddy));
if (!im) {
im = purple_im_conversation_new(purple_buddy_get_account(buddy),
purple_buddy_get_name(buddy));
} else {
- FinchConv *ggconv = FINCH_CONV(PURPLE_CONVERSATION(im));
+ FinchConv *ggconv = FINCH_CONV(im);
gnt_window_present(ggconv->window);
}
- finch_conversation_set_active(PURPLE_CONVERSATION(im));
+ finch_conversation_set_active(im);
}
else if (PURPLE_IS_CHAT(node))
{
@@ -2602,13 +2602,13 @@
{
PurpleAccount *account;
const char *username;
- PurpleIMConversation *im;
+ PurpleConversation *im;
account = purple_request_fields_get_account(fields, "account");
username = purple_request_fields_get_string(fields, "screenname");
im = purple_im_conversation_new(account, username);
- purple_conversation_present(PURPLE_CONVERSATION(im));
+ purple_conversation_present(im);
}
static void
@@ -2652,7 +2652,7 @@
PurpleConnection *gc;
PurpleChat *chat;
GHashTable *hash = NULL;
- PurpleChatConversation *conv;
+ PurpleConversation *conv;
account = purple_request_fields_get_account(fields, "account");
name = purple_request_fields_get_string(fields, "chat");
@@ -2666,9 +2666,9 @@
* a new conversation window will pop up when we finally join the chat. */
if (!(conv = purple_conversations_find_chat_with_account(name, account))) {
conv = purple_chat_conversation_new(account, name);
- purple_chat_conversation_leave(conv);
+ purple_chat_conversation_leave(PURPLE_CHAT_CONVERSATION(conv));
} else {
- purple_conversation_present(PURPLE_CONVERSATION(conv));
+ purple_conversation_present(conv);
}
chat = purple_blist_find_chat(account, name);
--- a/finch/gntconv.c Mon May 17 20:32:56 2021 -0500
+++ b/finch/gntconv.c Tue May 18 02:04:53 2021 -0500
@@ -190,12 +190,12 @@
purple_prefs_set_int(PREF_ROOT "/position/y", y);
}
-static PurpleIMConversation *
+static PurpleConversation *
find_im_with_contact(PurpleAccount *account, const char *name)
{
PurpleBlistNode *node;
PurpleBuddy *buddy = purple_blist_find_buddy(account, name);
- PurpleIMConversation *im = NULL;
+ PurpleConversation *im = NULL;
if (!buddy)
return NULL;
@@ -224,16 +224,16 @@
update_buddy_typing(PurpleAccount *account, const char *who, gpointer null)
{
FinchConv *ggc;
+ PurpleConversation *conv;
PurpleIMConversation *im;
- PurpleConversation *conv;
char *title, *str;
- im = purple_conversations_find_im_with_account(who, account);
+ conv = purple_conversations_find_im_with_account(who, account);
- if (!im)
+ if (!conv)
return;
- conv = PURPLE_CONVERSATION(im);
+ im = PURPLE_IM_CONVERSATION(conv);
ggc = FINCH_CONV(conv);
if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_TYPING) {
@@ -270,10 +270,10 @@
static void
buddy_signed_on_off(PurpleBuddy *buddy, gpointer null)
{
- PurpleIMConversation *im = find_im_with_contact(purple_buddy_get_account(buddy), purple_buddy_get_name(buddy));
+ PurpleConversation *im = find_im_with_contact(purple_buddy_get_account(buddy), purple_buddy_get_name(buddy));
if (im == NULL)
return;
- generate_send_to_menu(FINCH_CONV(PURPLE_CONVERSATION(im)));
+ generate_send_to_menu(FINCH_CONV(im));
}
static void
@@ -282,10 +282,10 @@
GList *list = purple_conversations_get_ims();
while (list) {
PurpleConversation *conv = list->data;
- PurpleIMConversation *cc = find_im_with_contact(
+ PurpleConversation *cc = find_im_with_contact(
purple_conversation_get_account(conv), purple_conversation_get_name(conv));
if (cc)
- generate_send_to_menu(FINCH_CONV(PURPLE_CONVERSATION(cc)));
+ generate_send_to_menu(FINCH_CONV(cc));
list = list->next;
}
@@ -462,8 +462,8 @@
{
PurpleAccount *account = g_object_get_data(G_OBJECT(m), "purple_account");
gchar *buddy = g_object_get_data(G_OBJECT(m), "purple_buddy_name");
- PurpleIMConversation *im = purple_im_conversation_new(account, buddy);
- finch_conversation_set_active(PURPLE_CONVERSATION(im));
+ PurpleConversation *im = purple_im_conversation_new(account, buddy);
+ finch_conversation_set_active(im);
}
static void
@@ -736,7 +736,7 @@
}
account = purple_conversation_get_account(conv);
- cc = PURPLE_CONVERSATION(find_im_with_contact(account, purple_conversation_get_name(conv)));
+ cc = find_im_with_contact(account, purple_conversation_get_name(conv));
if (cc && FINCH_CONV(cc))
ggc = FINCH_CONV(cc);
else
--- a/libpurple/buddy.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/buddy.c Tue May 18 02:04:53 2021 -0500
@@ -436,7 +436,7 @@
purple_buddy_set_local_alias(PurpleBuddy *buddy, const gchar *alias) {
PurpleBuddyList *blist = NULL;
PurpleBuddyPrivate *priv = NULL;
- PurpleIMConversation *im = NULL;
+ PurpleConversation *im = NULL;
gchar *old_alias = NULL, *new_alias = NULL;
g_return_if_fail(PURPLE_IS_BUDDY(buddy));
@@ -469,7 +469,7 @@
im = purple_conversations_find_im_with_account(priv->name, priv->account);
if(PURPLE_IS_IM_CONVERSATION(im)) {
- purple_conversation_autoset_title(PURPLE_CONVERSATION(im));
+ purple_conversation_autoset_title(im);
}
purple_signal_emit(purple_blist_get_handle(), "blist-node-aliased", buddy,
@@ -492,7 +492,7 @@
purple_buddy_set_server_alias(PurpleBuddy *buddy, const gchar *alias) {
PurpleBuddyList *blist = NULL;
PurpleBuddyPrivate *priv = NULL;
- PurpleIMConversation *im = NULL;
+ PurpleConversation *im = NULL;
gchar *old_alias = NULL, *new_alias = NULL;
g_return_if_fail(PURPLE_IS_BUDDY(buddy));
@@ -527,7 +527,7 @@
im = purple_conversations_find_im_with_account(priv->name, priv->account);
if(PURPLE_IS_IM_CONVERSATION(im)) {
- purple_conversation_autoset_title(PURPLE_CONVERSATION(im));
+ purple_conversation_autoset_title(im);
}
purple_signal_emit(purple_blist_get_handle(), "blist-node-aliased", buddy,
--- a/libpurple/buddyicon.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/buddyicon.c Tue May 18 02:04:53 2021 -0500
@@ -378,7 +378,7 @@
void
purple_buddy_icon_update(PurpleBuddyIcon *icon)
{
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleAccount *account;
const char *username;
PurpleBuddyIcon *icon_to_set;
@@ -441,9 +441,10 @@
}
im = purple_conversations_find_im_with_account(username, account);
-
- if (im != NULL)
- purple_im_conversation_set_icon(im, icon_to_set);
+ if(PURPLE_IS_IM_CONVERSATION(im)) {
+ purple_im_conversation_set_icon(PURPLE_IM_CONVERSATION(im),
+ icon_to_set);
+ }
/* icon's refcount was incremented above */
purple_buddy_icon_unref(icon);
@@ -914,7 +915,7 @@
child = purple_blist_node_get_sibling_next(child))
{
PurpleBuddy *buddy;
- PurpleIMConversation *im;
+ PurpleConversation *im;
if (!PURPLE_IS_BUDDY(child))
continue;
@@ -923,7 +924,7 @@
im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
if (im)
- purple_conversation_update(PURPLE_CONVERSATION(im), PURPLE_CONVERSATION_UPDATE_ICON);
+ purple_conversation_update(im, PURPLE_CONVERSATION_UPDATE_ICON);
/* Is this call necessary anymore? Can the buddies
* themselves need updating when the custom buddy
@@ -932,11 +933,11 @@
PURPLE_BLIST_NODE(buddy));
}
} else if (PURPLE_IS_CHAT(node)) {
- PurpleChatConversation *chat = NULL;
+ PurpleConversation *chat = NULL;
chat = purple_conversations_find_chat_with_account(purple_chat_get_name((PurpleChat*)node), purple_chat_get_account((PurpleChat*)node));
if (chat) {
- purple_conversation_update(PURPLE_CONVERSATION(chat), PURPLE_CONVERSATION_UPDATE_ICON);
+ purple_conversation_update(chat, PURPLE_CONVERSATION_UPDATE_ICON);
}
}
--- a/libpurple/contact.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/contact.c Tue May 18 02:04:53 2021 -0500
@@ -113,7 +113,7 @@
purple_contact_set_alias(PurpleContact *contact, const char *alias)
{
PurpleContactPrivate *priv = NULL;
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleBlistNode *bnode;
char *old_alias;
char *new_alias = NULL;
@@ -153,7 +153,7 @@
im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy),
purple_buddy_get_account(buddy));
if (im)
- purple_conversation_autoset_title(PURPLE_CONVERSATION(im));
+ purple_conversation_autoset_title(im);
}
purple_signal_emit(purple_blist_get_handle(), "blist-node-aliased",
--- a/libpurple/conversations.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/conversations.c Tue May 18 02:04:53 2021 -0500
@@ -184,11 +184,11 @@
return c;
}
-PurpleIMConversation *
+PurpleConversation *
purple_conversations_find_im_with_account(const char *name,
PurpleAccount *account)
{
- PurpleIMConversation *im = NULL;
+ PurpleConversation *im = NULL;
struct _purple_hconv hc;
g_return_val_if_fail(name != NULL, NULL);
@@ -202,11 +202,11 @@
return im;
}
-PurpleChatConversation *
+PurpleConversation *
purple_conversations_find_chat_with_account(const char *name,
PurpleAccount *account)
{
- PurpleChatConversation *c = NULL;
+ PurpleConversation *c = NULL;
struct _purple_hconv hc;
g_return_val_if_fail(name != NULL, NULL);
@@ -220,17 +220,17 @@
return c;
}
-PurpleChatConversation *
+PurpleConversation *
purple_conversations_find_chat(const PurpleConnection *gc, int id)
{
GList *l;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
for (l = purple_conversations_get_chats(); l != NULL; l = l->next) {
- chat = (PurpleChatConversation *)l->data;
+ chat = (PurpleConversation *)l->data;
- if (purple_chat_conversation_get_id(chat) == id &&
- purple_conversation_get_connection(PURPLE_CONVERSATION(chat)) == gc)
+ if (purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)) == id &&
+ purple_conversation_get_connection(chat) == gc)
return chat;
}
--- a/libpurple/conversations.h Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/conversations.h Tue May 18 02:04:53 2021 -0500
@@ -33,7 +33,7 @@
* @see_also: <link linkend="chapter-signals-conversation">Conversation signals</link>
*/
-#include "purplechatconversation.h"
+#include <purpleconversation.h>
#include "server.h"
G_BEGIN_DECLS
@@ -108,8 +108,7 @@
*
* Returns: (transfer none): The conversation if found, or %NULL otherwise.
*/
-PurpleIMConversation *purple_conversations_find_im_with_account(const char *name,
- PurpleAccount *account);
+PurpleConversation *purple_conversations_find_im_with_account(const char *name, PurpleAccount *account);
/**
* purple_conversations_find_chat_with_account:
@@ -120,8 +119,7 @@
*
* Returns: (transfer none): The conversation if found, or %NULL otherwise.
*/
-PurpleChatConversation *purple_conversations_find_chat_with_account(const char *name,
- PurpleAccount *account);
+PurpleConversation *purple_conversations_find_chat_with_account(const char *name, PurpleAccount *account);
/**
* purple_conversations_find_chat:
@@ -132,7 +130,7 @@
*
* Returns: (transfer none): The chat conversation.
*/
-PurpleChatConversation *purple_conversations_find_chat(const PurpleConnection *gc, int id);
+PurpleConversation *purple_conversations_find_chat(const PurpleConnection *gc, int id);
/**
* purple_conversations_set_ui_ops:
--- a/libpurple/plugins/psychic.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/plugins/psychic.c Tue May 18 02:04:53 2021 -0500
@@ -38,7 +38,7 @@
static void
buddy_typing_cb(PurpleAccount *acct, const char *name, void *data) {
- PurpleIMConversation *im;
+ PurpleConversation *im;
if(purple_prefs_get_bool(PREF_STATUS) &&
! purple_status_is_available(purple_account_get_active_status(acct))) {
@@ -63,7 +63,7 @@
im = purple_im_conversation_new(acct, name);
if(purple_prefs_get_bool(PREF_RAISE)) {
- purple_conversation_present(PURPLE_CONVERSATION(im));
+ purple_conversation_present(im);
}
if(purple_prefs_get_bool(PREF_NOTICE)) {
@@ -72,13 +72,14 @@
translate it literally. If you can't find a fitting cultural
reference in your language, consider translating something
like this instead: "You feel a new message coming." */
- purple_conversation_write_system_message(PURPLE_CONVERSATION(im),
+ purple_conversation_write_system_message(im,
_("You feel a disturbance in the force..."),
PURPLE_MESSAGE_NO_LOG | PURPLE_MESSAGE_ACTIVE_ONLY);
}
/* Necessary because we may be creating a new conversation window. */
- purple_im_conversation_set_typing_state(im, PURPLE_IM_TYPING);
+ purple_im_conversation_set_typing_state(PURPLE_IM_CONVERSATION(im),
+ PURPLE_IM_TYPING);
}
}
--- a/libpurple/plugins/statenotify.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/plugins/statenotify.c Tue May 18 02:04:53 2021 -0500
@@ -25,7 +25,7 @@
write_status(PurpleBuddy *buddy, const char *message)
{
PurpleAccount *account = NULL;
- PurpleIMConversation *im;
+ PurpleConversation *im;
const char *who;
char buf[256];
char *escaped;
@@ -49,7 +49,7 @@
g_snprintf(buf, sizeof(buf), message, escaped);
g_free(escaped);
- purple_conversation_write_system_message(PURPLE_CONVERSATION(im), buf,
+ purple_conversation_write_system_message(im, buf,
PURPLE_MESSAGE_ACTIVE_ONLY | PURPLE_MESSAGE_NO_LINKIFY);
}
--- a/libpurple/protocols.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols.c Tue May 18 02:04:53 2021 -0500
@@ -363,7 +363,7 @@
PurpleAttentionType *attn;
PurpleProtocol *protocol;
PurpleProtocolManager *manager;
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleBuddy *buddy;
const char *alias;
gchar *description;
--- a/libpurple/protocols/facebook/facebook.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/facebook/facebook.c Tue May 18 02:04:53 2021 -0500
@@ -390,7 +390,7 @@
GHashTableIter iter;
GSList *l;
PurpleAccount *acct;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
PurpleConnection *gc;
gc = fb_data_get_connection(fata);
@@ -411,7 +411,7 @@
switch (event->type) {
case FB_API_EVENT_TYPE_THREAD_TOPIC:
- purple_chat_conversation_set_topic(chat, uid,
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat), uid,
event->text);
break;
@@ -431,12 +431,12 @@
}
}
- purple_chat_conversation_add_user(chat, uid, NULL, 0,
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(chat), uid, NULL, 0,
TRUE);
break;
case FB_API_EVENT_TYPE_THREAD_USER_REMOVED:
- purple_chat_conversation_remove_user(chat, uid, event->text);
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(chat), uid, event->text);
break;
}
}
@@ -506,7 +506,7 @@
gint64 tstamp;
GSList *l;
PurpleAccount *acct;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
PurpleConnection *gc;
PurpleMessageFlags flags;
@@ -577,7 +577,7 @@
purple_serv_got_joined_chat(gc, id, tid);
fb_api_thread(api, msg->tid);
} else {
- id = purple_chat_conversation_get_id(chat);
+ id = purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat));
}
if (mark && !isself) {
@@ -631,6 +631,7 @@
gint id;
GSList *l;
PurpleAccount *acct;
+ PurpleConversation *conv;
PurpleChatConversation *chat;
PurpleConnection *gc;
@@ -639,10 +640,10 @@
id = fb_id_hash(&thrd->tid);
FB_ID_TO_STR(thrd->tid, tid);
- chat = purple_conversations_find_chat_with_account(tid, acct);
-
- if ((chat == NULL) || purple_chat_conversation_has_left(chat)) {
- chat = purple_serv_got_joined_chat(gc, id, tid);
+ conv = purple_conversations_find_chat_with_account(tid, acct);
+ if((conv == NULL) || purple_chat_conversation_has_left(PURPLE_CHAT_CONVERSATION(conv))) {
+ conv = purple_serv_got_joined_chat(gc, id, tid);
+ chat = PURPLE_CHAT_CONVERSATION(conv);
active = FALSE;
} else {
/* If there are no users in the group chat, including
@@ -650,6 +651,7 @@
* setup by this function. As a result, any group chat
* without users is inactive.
*/
+ chat = PURPLE_CHAT_CONVERSATION(conv);
active = purple_chat_conversation_get_users_count(chat) > 0;
}
@@ -700,7 +702,7 @@
gchar tid[FB_ID_STRMAX];
PurpleAccount *acct;
PurpleConnection *gc;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
FB_ID_TO_STR(thrd->tid, tid);
@@ -720,10 +722,10 @@
return;
}
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat),
+ purple_conversation_write_system_message(chat,
_("You have been removed from this chat"), 0);
- purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(chat));
+ purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)));
}
static void
@@ -1305,7 +1307,7 @@
FbData *fata;
FbId tid;
gint id;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
PurpleRequestCommonParameters *cpar;
name = g_hash_table_lookup(data, "name");
@@ -1325,8 +1327,8 @@
id = fb_id_hash(&tid);
chat = purple_conversations_find_chat(gc, id);
- if ((chat != NULL) && !purple_chat_conversation_has_left(chat)) {
- purple_conversation_present(PURPLE_CONVERSATION(chat));
+ if ((chat != NULL) && !purple_chat_conversation_has_left(PURPLE_CHAT_CONVERSATION(chat))) {
+ purple_conversation_present(chat);
return;
}
@@ -1355,7 +1357,7 @@
FbData *fata;
FbId tid;
FbId uid;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
PurpleRequestCommonParameters *cpar;
if (!FB_ID_IS_STR(who)) {
@@ -1372,7 +1374,7 @@
api = fb_data_get_api(fata);
chat = purple_conversations_find_chat(gc, id);
- name = purple_conversation_get_name(PURPLE_CONVERSATION(chat));
+ name = purple_conversation_get_name(chat);
tid = FB_ID_FROM_STR(name);
uid = FB_ID_FROM_STR(who);
@@ -1390,14 +1392,14 @@
FbId tid;
gchar *sext;
PurpleAccount *acct;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
acct = purple_connection_get_account(gc);
fata = purple_connection_get_protocol_data(gc);
api = fb_data_get_api(fata);
chat = purple_conversations_find_chat(gc, id);
- name = purple_conversation_get_name(PURPLE_CONVERSATION(chat));
+ name = purple_conversation_get_name(chat);
tid = FB_ID_FROM_STR(name);
text = purple_message_get_contents(msg);
@@ -1421,13 +1423,13 @@
FbApi *api;
FbData *fata;
FbId tid;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
fata = purple_connection_get_protocol_data(gc);
api = fb_data_get_api(fata);
chat = purple_conversations_find_chat(gc, id);
- name = purple_conversation_get_name(PURPLE_CONVERSATION(chat));
+ name = purple_conversation_get_name(chat);
tid = FB_ID_FROM_STR(name);
fb_api_thread_topic(api, tid, topic);
}
--- a/libpurple/protocols/facebook/util.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/facebook/util.c Tue May 18 02:04:53 2021 -0500
@@ -436,7 +436,7 @@
GDateTime *dt = NULL;
const gchar *name, *me;
PurpleAccount *acct;
- PurpleIMConversation *conv;
+ PurpleConversation *conv;
PurpleMessage *msg;
if (!(flags & PURPLE_MESSAGE_SEND)) {
@@ -459,7 +459,7 @@
purple_message_set_timestamp(msg, dt);
g_date_time_unref(dt);
- purple_conversation_write_message(PURPLE_CONVERSATION(conv), msg);
+ purple_conversation_write_message(conv, msg);
g_object_unref(G_OBJECT(msg));
}
@@ -472,7 +472,7 @@
GDateTime *dt = NULL;
const gchar *name;
PurpleAccount *acct;
- PurpleChatConversation *conv;
+ PurpleConversation *conv;
PurpleMessage *msg;
const gchar *me;
@@ -493,7 +493,7 @@
purple_message_set_timestamp(msg, dt);
g_date_time_unref(dt);
- purple_conversation_write_message(PURPLE_CONVERSATION(conv), msg);
+ purple_conversation_write_message(conv, msg);
g_object_unref(G_OBJECT(msg));
}
--- a/libpurple/protocols/gg/chat.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/gg/chat.c Tue May 18 02:04:53 2021 -0500
@@ -140,13 +140,15 @@
static void ggp_chat_open_conv(ggp_chat_local_info *chat)
{
+ PurpleConversation *conv;
int i;
if (chat->conv != NULL)
return;
- chat->conv = purple_serv_got_joined_chat(chat->gc, chat->local_id,
+ conv = purple_serv_got_joined_chat(chat->gc, chat->local_id,
ggp_chat_get_name_from_id(chat->id));
+ chat->conv = PURPLE_CHAT_CONVERSATION(conv);
if (chat->previously_joined) {
purple_conversation_write_system_message(
PURPLE_CONVERSATION(chat->conv),
@@ -486,7 +488,7 @@
{
GGPInfo *info = purple_connection_get_protocol_data(gc);
GDateTime *dt = NULL;
- PurpleChatConversation *conv;
+ PurpleConversation *conv;
ggp_chat_local_info *chat;
gboolean succ = TRUE;
const gchar *me;
@@ -503,7 +505,7 @@
ggp_chat_get_name_from_id(chat->id),
purple_connection_get_account(gc));
- gg_msg = ggp_message_format_to_gg(PURPLE_CONVERSATION(conv),
+ gg_msg = ggp_message_format_to_gg(conv,
purple_message_get_contents(msg));
if (gg_chat_send_message(info->session, chat->id, gg_msg, TRUE) < 0)
--- a/libpurple/protocols/gg/gg.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/gg/gg.c Tue May 18 02:04:53 2021 -0500
@@ -612,7 +612,7 @@
{
GList *accounts;
GList *account_node;
- PurpleIMConversation *im;
+ PurpleConversation *im;
g_return_val_if_fail(screenname != NULL, FALSE);
@@ -635,7 +635,7 @@
}
im = purple_im_conversation_new(account_node->data, screenname);
- purple_conversation_present(PURPLE_CONVERSATION(im));
+ purple_conversation_present(im);
return TRUE;
}
--- a/libpurple/protocols/gg/message-prpl.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/gg/message-prpl.c Tue May 18 02:04:53 2021 -0500
@@ -83,7 +83,7 @@
static ggp_font * ggp_font_clone(ggp_font *font);
static void ggp_font_free(gpointer font);
-static PurpleIMConversation * ggp_message_get_conv(PurpleConnection *gc,
+static PurpleConversation * ggp_message_get_conv(PurpleConnection *gc,
uin_t uin);
static void ggp_message_got_data_free(ggp_message_got_data *msg);
static void ggp_message_got_display(PurpleConnection *gc,
@@ -162,11 +162,11 @@
/**/
-static PurpleIMConversation * ggp_message_get_conv(PurpleConnection *gc,
+static PurpleConversation * ggp_message_get_conv(PurpleConnection *gc,
uin_t uin)
{
PurpleAccount *account = purple_connection_get_account(gc);
- PurpleIMConversation *im;
+ PurpleConversation *im;
const gchar *who = ggp_uin_to_str(uin);
im = purple_conversations_find_im_with_account(who, account);
@@ -237,7 +237,7 @@
} else if (msg->type == GGP_MESSAGE_GOT_TYPE_MULTILOGON) {
GDateTime *dt = NULL;
PurpleAccount *account = NULL;
- PurpleIMConversation *im = ggp_message_get_conv(gc, msg->user);
+ PurpleConversation *im = ggp_message_get_conv(gc, msg->user);
PurpleMessage *pmsg;
const gchar *me = NULL;
@@ -250,7 +250,7 @@
purple_message_set_timestamp(pmsg, dt);
g_date_time_unref(dt);
- purple_conversation_write_message(PURPLE_CONVERSATION(im), pmsg);
+ purple_conversation_write_message(im, pmsg);
g_object_unref(G_OBJECT(pmsg));
} else {
@@ -646,7 +646,7 @@
PurpleMessage *msg)
{
GGPInfo *info = purple_connection_get_protocol_data(gc);
- PurpleIMConversation *im;
+ PurpleConversation *im;
ggp_buddy_data *buddy_data;
gchar *gg_msg;
gboolean succ;
@@ -666,7 +666,7 @@
im = purple_conversations_find_im_with_account(
rcpt, purple_connection_get_account(gc));
- gg_msg = ggp_message_format_to_gg(PURPLE_CONVERSATION(im),
+ gg_msg = ggp_message_format_to_gg(im,
purple_message_get_contents(msg));
/* TODO: splitting messages */
--- a/libpurple/protocols/irc/cmds.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/irc/cmds.c Tue May 18 02:04:53 2021 -0500
@@ -520,14 +520,14 @@
int irc_cmd_query(struct irc_conn *irc, const char *cmd, const char *target, const char **args)
{
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleConnection *gc;
if (!args || !args[0])
return 0;
im = purple_im_conversation_new(irc->account, args[0]);
- purple_conversation_present(PURPLE_CONVERSATION(im));
+ purple_conversation_present(im);
if (args[1]) {
PurpleMessage *message = NULL;
@@ -541,7 +541,7 @@
recipient = purple_connection_get_display_name(gc);
message = purple_message_new_outgoing(me, recipient, args[1], 0);
- purple_conversation_write_message(PURPLE_CONVERSATION(im), message);
+ purple_conversation_write_message(im, message);
g_object_unref(G_OBJECT(message));
}
@@ -601,7 +601,7 @@
{
char *buf;
const char *topic;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
if (!args)
return 0;
@@ -611,7 +611,7 @@
return 0;
if (!args[0]) {
- topic = purple_chat_conversation_get_topic (chat);
+ topic = purple_chat_conversation_get_topic (PURPLE_CHAT_CONVERSATION(chat));
if (topic) {
char *tmp, *tmp2;
@@ -623,7 +623,7 @@
} else
buf = g_strdup(_("No topic is set"));
purple_conversation_write_system_message(
- PURPLE_CONVERSATION(chat), buf, PURPLE_MESSAGE_NO_LOG);
+ chat, buf, PURPLE_MESSAGE_NO_LOG);
g_free(buf);
return 0;
--- a/libpurple/protocols/irc/irc.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/irc/irc.c Tue May 18 02:04:53 2021 -0500
@@ -151,7 +151,7 @@
g_strfreev(target_tokens);
if (isnick) {
- PurpleIMConversation *im;
+ PurpleConversation *im;
/* 'server' isn't needed here. Free it immediately. */
g_free(server);
@@ -160,14 +160,13 @@
im = purple_im_conversation_new(account, target + 1);
g_free(target);
- purple_conversation_present(PURPLE_CONVERSATION(im));
+ purple_conversation_present(im);
if (params != NULL) {
const gchar *msg = g_hash_table_lookup(params, "msg");
if (msg != NULL) {
- purple_conversation_send_confirm(
- PURPLE_CONVERSATION(im), msg);
+ purple_conversation_send_confirm(im, msg);
}
}
--- a/libpurple/protocols/irc/msgs.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/irc/msgs.c Tue May 18 02:04:53 2021 -0500
@@ -258,7 +258,7 @@
void irc_msg_ban(struct irc_conn *irc, const char *name, const char *from, char **args)
{
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
chat = purple_conversations_find_chat_with_account(args[1], irc->account);
@@ -278,7 +278,7 @@
}
if (chat) {
purple_conversation_write_system_message(
- PURPLE_CONVERSATION(chat), msg, PURPLE_MESSAGE_NO_LOG);
+ chat, msg, PURPLE_MESSAGE_NO_LOG);
} else {
purple_debug_info("irc", "%s\n", msg);
}
@@ -287,7 +287,7 @@
if (!chat)
return;
/* End of ban list */
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat),
+ purple_conversation_write_system_message(chat,
_("End of ban list"), PURPLE_MESSAGE_NO_LOG);
}
}
@@ -307,7 +307,7 @@
void irc_msg_banfull(struct irc_conn *irc, const char *name, const char *from, char **args)
{
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
char *buf, *nick;
chat = purple_conversations_find_chat_with_account(args[1], irc->account);
@@ -317,14 +317,14 @@
nick = g_markup_escape_text(args[2], -1);
buf = g_strdup_printf(_("Cannot ban %s: banlist is full"), nick);
g_free(nick);
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat),
+ purple_conversation_write_system_message(chat,
buf, PURPLE_MESSAGE_NO_LOG);
g_free(buf);
}
void irc_msg_chanmode(struct irc_conn *irc, const char *name, const char *from, char **args)
{
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
char *buf, *escaped;
chat = purple_conversations_find_chat_with_account(args[1], irc->account);
@@ -333,7 +333,7 @@
escaped = (args[3] != NULL) ? g_markup_escape_text(args[3], -1) : NULL;
buf = g_strdup_printf("mode for %s: %s %s", args[1], args[2], escaped ? escaped : "");
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), buf, 0);
+ purple_conversation_write_system_message(chat, buf, 0);
g_free(escaped);
g_free(buf);
}
@@ -465,7 +465,7 @@
void irc_msg_who(struct irc_conn *irc, const char *name, const char *from, char **args)
{
if (purple_strequal(name, "352")) {
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
PurpleChatUser *cb;
char *cur, *userhost, *realname;
@@ -478,7 +478,7 @@
return;
}
- cb = purple_chat_conversation_find_user(chat, args[5]);
+ cb = purple_chat_conversation_find_user(PURPLE_CHAT_CONVERSATION(chat), args[5]);
if (!cb) {
purple_debug_error("irc", "Got a WHO response for %s who isn't a buddy.", args[5]);
return;
@@ -552,7 +552,7 @@
void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args)
{
char *chan, *topic, *msg, *nick, *tmp, *tmp2;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
if (purple_strequal(name, "topic")) {
chan = args[0];
@@ -574,13 +574,13 @@
tmp2 = purple_markup_linkify(tmp);
g_free(tmp);
if (purple_strequal(name, "topic")) {
- const char *current_topic = purple_chat_conversation_get_topic(chat);
+ const char *current_topic = purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(chat));
if (!(current_topic != NULL && purple_strequal(tmp2, current_topic)))
{
char *nick_esc;
nick = irc_mask_nick(from);
nick_esc = g_markup_escape_text(nick, -1);
- purple_chat_conversation_set_topic(chat, nick, topic);
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat), nick, topic);
if (*tmp2)
msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick_esc, tmp2);
else
@@ -588,15 +588,15 @@
g_free(nick_esc);
g_free(nick);
purple_conversation_write_system_message(
- PURPLE_CONVERSATION(chat), msg, 0);
+ chat, msg, 0);
g_free(msg);
}
} else {
char *chan_esc = g_markup_escape_text(chan, -1);
msg = g_strdup_printf(_("The topic for %s is: %s"), chan_esc, tmp2);
g_free(chan_esc);
- purple_chat_conversation_set_topic(chat, NULL, topic);
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), msg, 0);
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat), NULL, topic);
+ purple_conversation_write_system_message(chat, msg, 0);
g_free(msg);
}
g_free(tmp2);
@@ -605,7 +605,7 @@
void irc_msg_topicinfo(struct irc_conn *irc, const char *name, const char *from, char **args)
{
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
GDateTime *dt, *local;
gint64 mtime;
char *msg, *timestamp, *datestamp;
@@ -634,7 +634,7 @@
timestamp = g_date_time_format(local, "%X");
datestamp = g_date_time_format(local, "%x");
msg = g_strdup_printf(_("Topic for %s set by %s at %s on %s"), args[1], args[2], timestamp, datestamp);
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat),
+ purple_conversation_write_system_message(chat,
msg, PURPLE_MESSAGE_NO_LINKIFY);
g_free(timestamp);
g_free(datestamp);
@@ -821,11 +821,11 @@
void irc_msg_nosend(struct irc_conn *irc, const char *name, const char *from, char **args)
{
PurpleConnection *gc;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
chat = purple_conversations_find_chat_with_account(args[1], irc->account);
if (chat) {
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), args[2],
+ purple_conversation_write_system_message(chat, args[2],
PURPLE_MESSAGE_NO_LOG);
} else {
if ((gc = purple_account_get_connection(irc->account)) == NULL)
@@ -837,26 +837,26 @@
void irc_msg_notinchan(struct irc_conn *irc, const char *name, const char *from, char **args)
{
- PurpleChatConversation *chat = purple_conversations_find_chat_with_account(args[1], irc->account);
+ PurpleConversation *chat = purple_conversations_find_chat_with_account(args[1], irc->account);
purple_debug_info("irc", "We're apparently not in %s, but tried to use it", args[1]);
if (chat) {
/*g_slist_remove(irc->gc->buddy_chats, chat);
purple_conversation_set_account(chat, NULL);*/
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat),
+ purple_conversation_write_system_message(chat,
args[2], PURPLE_MESSAGE_NO_LOG);
}
}
void irc_msg_notop(struct irc_conn *irc, const char *name, const char *from, char **args)
{
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
chat = purple_conversations_find_chat_with_account(args[1], irc->account);
if (!chat)
return;
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), args[2], 0);
+ purple_conversation_write_system_message(chat, args[2], 0);
}
void irc_msg_invite(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -931,7 +931,7 @@
void irc_msg_join(struct irc_conn *irc, const char *name, const char *from, char **args)
{
PurpleConnection *gc = purple_account_get_connection(irc->account);
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
PurpleChatUser *cb;
char *nick, *userhost, *buf;
@@ -976,9 +976,9 @@
userhost = irc_mask_userhost(from);
- purple_chat_conversation_add_user(chat, nick, userhost, PURPLE_CHAT_USER_NONE, TRUE);
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(chat), nick, userhost, PURPLE_CHAT_USER_NONE, TRUE);
- cb = purple_chat_conversation_find_user(chat, nick);
+ cb = purple_chat_conversation_find_user(PURPLE_CHAT_CONVERSATION(chat), nick);
if (cb) {
g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, g_free);
@@ -995,7 +995,7 @@
void irc_msg_kick(struct irc_conn *irc, const char *name, const char *from, char **args)
{
PurpleConnection *gc = purple_account_get_connection(irc->account);
- PurpleChatConversation *chat = purple_conversations_find_chat_with_account(args[0], irc->account);
+ PurpleConversation *chat = purple_conversations_find_chat_with_account(args[0], irc->account);
char *nick, *buf;
g_return_if_fail(gc);
@@ -1012,10 +1012,10 @@
buf = g_strdup_printf(_("You have been kicked by %s: (%s)"), nick, args[2]);
purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), buf, 0);
g_free(buf);
- purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(chat));
+ purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)));
} else {
buf = g_strdup_printf(_("Kicked by %s (%s)"), nick, args[2]);
- purple_chat_conversation_remove_user(chat, args[1], buf);
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(chat), args[1], buf);
g_free(buf);
}
@@ -1024,7 +1024,7 @@
void irc_msg_mode(struct irc_conn *irc, const char *name, const char *from, char **args)
{
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
char *nick = irc_mask_nick(from), *buf;
if (*args[0] == '#' || *args[0] == '&') { /* Channel */
@@ -1037,7 +1037,7 @@
}
escaped = (args[2] != NULL) ? g_markup_escape_text(args[2], -1) : NULL;
buf = g_strdup_printf(_("mode (%s %s) by %s"), args[1], escaped ? escaped : "", nick);
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), buf, 0);
+ purple_conversation_write_system_message(chat, buf, 0);
g_free(escaped);
g_free(buf);
if(args[2]) {
@@ -1057,7 +1057,7 @@
if (!end)
end = cur + strlen(cur);
user = g_strndup(cur, end - cur);
- cb = purple_chat_conversation_find_user(chat, user);
+ cb = purple_chat_conversation_find_user(PURPLE_CHAT_CONVERSATION(chat), user);
flags = purple_chat_user_get_flags(cb);
newflag = PURPLE_CHAT_USER_NONE;
if (*mcur == 'o')
@@ -1092,7 +1092,7 @@
void irc_msg_nick(struct irc_conn *irc, const char *name, const char *from, char **args)
{
PurpleConnection *gc = purple_account_get_connection(irc->account);
- PurpleIMConversation *im;
+ PurpleConversation *im;
GSList *chats;
char *nick = irc_mask_nick(from);
@@ -1119,7 +1119,7 @@
im = purple_conversations_find_im_with_account(nick,
irc->account);
if (im != NULL)
- purple_conversation_set_name(PURPLE_CONVERSATION(im), args[0]);
+ purple_conversation_set_name(im, args[0]);
g_free(nick);
}
@@ -1201,7 +1201,7 @@
void irc_msg_part(struct irc_conn *irc, const char *name, const char *from, char **args)
{
PurpleConnection *gc = purple_account_get_connection(irc->account);
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
char *nick, *msg, *channel;
g_return_if_fail(gc);
@@ -1223,12 +1223,12 @@
(args[1] && *args[1]) ? ": " : "",
(escaped && *escaped) ? escaped : "");
g_free(escaped);
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), msg, 0);
+ purple_conversation_write_system_message(chat, msg, 0);
g_free(msg);
- purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(chat));
+ purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)));
} else {
msg = args[1] ? irc_mirc2txt(args[1]) : NULL;
- purple_chat_conversation_remove_user(chat, nick, msg);
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(chat), nick, msg);
g_free(msg);
}
g_free(nick);
@@ -1289,7 +1289,7 @@
static void irc_msg_handle_privmsg(struct irc_conn *irc, const char *name, const char *from, const char *to, const char *rawmsg, gboolean notice)
{
PurpleConnection *gc = purple_account_get_connection(irc->account);
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
char *tmp;
char *msg;
char *nick;
@@ -1321,7 +1321,7 @@
} else {
chat = purple_conversations_find_chat_with_account(irc_nick_skip_mode(irc, to), irc->account);
if (chat) {
- purple_serv_got_chat_in(gc, purple_chat_conversation_get_id(chat),
+ purple_serv_got_chat_in(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)),
nick, PURPLE_MESSAGE_RECV, msg, time(NULL));
} else
purple_debug_error("irc", "Got a %s on %s, which does not exist\n",
--- a/libpurple/protocols/jabber/jabber.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/jabber/jabber.c Tue May 18 02:04:53 2021 -0500
@@ -3796,18 +3796,17 @@
/* params is NULL if the URI has no '?' (or anything after it) */
if (!params || g_hash_table_lookup_extended(params, "message", NULL, NULL)) {
if (user && *user) {
- PurpleIMConversation *im =
- purple_im_conversation_new(acct, user);
+ PurpleConversation *im = purple_im_conversation_new(acct, user);
const gchar *body = NULL;
- purple_conversation_present(PURPLE_CONVERSATION(im));
+ purple_conversation_present(im);
if (params != NULL) {
body = g_hash_table_lookup(params, "body");
}
if (body && *body)
- purple_conversation_send_confirm(PURPLE_CONVERSATION(im), body);
+ purple_conversation_send_confirm(im, body);
return TRUE;
}
} else if (g_hash_table_lookup_extended(params, "roster", NULL, NULL)) {
--- a/libpurple/protocols/jabber/message.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/jabber/message.c Tue May 18 02:04:53 2021 -0500
@@ -130,7 +130,7 @@
purple_serv_got_typing(gc, contact, 0, PURPLE_IM_TYPED);
break;
case JM_STATE_GONE: {
- PurpleIMConversation *im = purple_conversations_find_im_with_account(
+ PurpleConversation *im = purple_conversations_find_im_with_account(
contact, account);
if (im && jid->node && jid->domain) {
char buf[256];
@@ -152,8 +152,7 @@
/* At some point when we restructure PurpleConversation,
* this should be able to be implemented by removing the
* user from the conversation like we do with chats now. */
- purple_conversation_write_system_message(
- PURPLE_CONVERSATION(im), buf, 0);
+ purple_conversation_write_system_message(im, buf, 0);
}
}
purple_serv_got_typing_stopped(gc, contact);
@@ -176,14 +175,14 @@
* This works because purple_im_conversation_send gets the name
* from purple_conversation_get_name()
*/
- PurpleIMConversation *im;
+ PurpleConversation *im;
im = purple_conversations_find_im_with_account(contact, account);
if (im && !purple_strequal(contact,
- purple_conversation_get_name(PURPLE_CONVERSATION(im)))) {
+ purple_conversation_get_name(im))) {
purple_debug_info("jabber", "Binding conversation to %s\n",
contact);
- purple_conversation_set_name(PURPLE_CONVERSATION(im), contact);
+ purple_conversation_set_name(im, contact);
}
}
--- a/libpurple/protocols/jabber/presence.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/jabber/presence.c Tue May 18 02:04:53 2021 -0500
@@ -575,9 +575,11 @@
}
if(!chat->conv) {
+ PurpleConversation *conv;
char *room_jid = g_strdup_printf("%s@%s", presence->jid_from->node, presence->jid_from->domain);
chat->id = i++;
- chat->conv = purple_serv_got_joined_chat(js->gc, chat->id, room_jid);
+ conv = purple_serv_got_joined_chat(js->gc, chat->id, room_jid);
+ chat->conv = PURPLE_CHAT_CONVERSATION(conv);
purple_chat_conversation_set_nick(chat->conv, chat->handle);
jabber_chat_disco_traffic(chat);
@@ -762,7 +764,7 @@
PurpleAccount *account;
PurpleBuddy *b;
char *buddy_name;
- PurpleIMConversation *im;
+ PurpleConversation *im;
buddy_name = jabber_id_get_bare_jid(presence->jid_from);
@@ -777,8 +779,8 @@
im = purple_conversations_find_im_with_account(buddy_name, account);
if (im) {
purple_debug_info("jabber", "Changed conversation binding from %s to %s\n",
- purple_conversation_get_name(PURPLE_CONVERSATION(im)), buddy_name);
- purple_conversation_set_name(PURPLE_CONVERSATION(im), buddy_name);
+ purple_conversation_get_name(im), buddy_name);
+ purple_conversation_set_name(im, buddy_name);
}
if (b == NULL) {
--- a/libpurple/protocols/novell/novell.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/novell/novell.c Tue May 18 02:04:53 2021 -0500
@@ -654,7 +654,7 @@
_join_conf_resp_cb(NMUser * user, NMERR_T ret_code,
gpointer resp_data, gpointer user_data)
{
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
PurpleConnection *gc;
NMUserRecord *ur;
NMConference *conference = user_data;
@@ -678,7 +678,7 @@
ur = nm_conference_get_participant(conference, i);
if (ur) {
name = nm_user_record_get_display_id(ur);
- purple_chat_conversation_add_user(chat, name, NULL,
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(chat), name, NULL,
PURPLE_CHAT_USER_NONE, TRUE);
}
}
@@ -1612,7 +1612,7 @@
NMUser *user;
const char *conf_name;
- PurpleChatConversation *chat = NULL;
+ PurpleConversation *chat = NULL;
NMUserRecord *user_record;
NMConference *conference;
@@ -1771,7 +1771,7 @@
{
NMUserRecord *user_record = NULL;
NMContact *contact = NULL;
- PurpleIMConversation *im;
+ PurpleConversation *im;
NMConference *conference;
PurpleMessageFlags flags;
char *text = NULL;
@@ -1781,7 +1781,7 @@
conference = nm_event_get_conference(event);
if (conference) {
- PurpleChatConversation *chat = nm_conference_get_data(conference);
+ PurpleConversation *chat = nm_conference_get_data(conference);
/* Is this a single person 'conversation' or a conference? */
if (chat == NULL && nm_conference_get_participant_count(conference) == 1) {
@@ -1806,7 +1806,7 @@
contact = nm_find_contact(user, nm_event_get_source(event));
if (contact) {
- purple_conversation_set_title(PURPLE_CONVERSATION(im),
+ purple_conversation_set_title(im,
nm_contact_get_display_name(contact));
@@ -1818,7 +1818,7 @@
if (name == NULL)
name = nm_user_record_get_userid(user_record);
- purple_conversation_set_title(PURPLE_CONVERSATION(im), name);
+ purple_conversation_set_title(im, name);
}
}
@@ -1849,7 +1849,7 @@
}
purple_serv_got_chat_in(purple_account_get_connection(user->client_data),
- purple_chat_conversation_get_id(chat),
+ purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)),
name, PURPLE_MESSAGE_RECV, text, nm_event_get_gmt(event));
}
}
@@ -1948,7 +1948,7 @@
static void
_evt_conference_joined(NMUser * user, NMEvent * event)
{
- PurpleChatConversation *chat = NULL;
+ PurpleConversation *chat = NULL;
PurpleConnection *gc;
NMConference *conference = NULL;
NMUserRecord *ur = NULL;
@@ -1973,7 +1973,7 @@
nm_conference_set_data(conference, (gpointer) chat);
name = nm_user_record_get_display_id(ur);
- purple_chat_conversation_add_user(chat, name, NULL,
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(chat), name, NULL,
PURPLE_CHAT_USER_NONE, TRUE);
}
@@ -1984,8 +1984,8 @@
ur = nm_find_user_record(user, nm_event_get_source(event));
if (ur) {
name = nm_user_record_get_display_id(ur);
- if (!purple_chat_conversation_has_user(chat, name)) {
- purple_chat_conversation_add_user(chat, name, NULL,
+ if (!purple_chat_conversation_has_user(PURPLE_CHAT_CONVERSATION(chat), name)) {
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(chat), name, NULL,
PURPLE_CHAT_USER_NONE, TRUE);
}
}
@@ -2470,7 +2470,7 @@
gint id, PurpleMessage *msg)
{
NMConference *conference;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
GSList *cnode;
NMMessage *message;
NMUser *user;
@@ -2492,7 +2492,7 @@
for (cnode = user->conferences; cnode != NULL; cnode = cnode->next) {
conference = cnode->data;
if (conference && (chat = nm_conference_get_data(conference))) {
- if (purple_chat_conversation_get_id(chat) == id) {
+ if (purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)) == id) {
nm_message_set_conference(message, conference);
@@ -2538,7 +2538,7 @@
if (chat) {
str = g_strdup(_("This conference has been closed."
" No more messages can be sent."));
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), str, 0);
+ purple_conversation_write_system_message(chat, str, 0);
g_free(str);
}
--- a/libpurple/protocols/null/nullprpl.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/null/nullprpl.c Tue May 18 02:04:53 2021 -0500
@@ -116,12 +116,12 @@
}
-typedef void(*ChatFunc)(PurpleChatConversation *from, PurpleChatConversation *to,
+typedef void(*ChatFunc)(PurpleConversation *from, PurpleConversation *to,
int id, const char *room, gpointer userdata);
typedef struct {
ChatFunc fn;
- PurpleChatConversation *from_chat;
+ PurpleConversation *from_chat;
gpointer userdata;
} ChatFuncData;
@@ -129,16 +129,16 @@
PurpleConnection *to = (PurpleConnection *)data;
ChatFuncData *cfdata = (ChatFuncData *)userdata;
- int id = purple_chat_conversation_get_id(cfdata->from_chat);
- PurpleChatConversation *chat = purple_conversations_find_chat(to, id);
+ int id = purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(cfdata->from_chat));
+ PurpleConversation *chat = purple_conversations_find_chat(to, id);
if (chat)
cfdata->fn(cfdata->from_chat, chat, id,
- purple_conversation_get_name(PURPLE_CONVERSATION(chat)), cfdata->userdata);
+ purple_conversation_get_name(chat), cfdata->userdata);
}
static void foreach_gc_in_chat(ChatFunc fn, PurpleConnection *from,
int id, gpointer userdata) {
- PurpleChatConversation *chat = purple_conversations_find_chat(from, id);
+ PurpleConversation *chat = purple_conversations_find_chat(from, id);
ChatFuncData cfdata = { fn,
chat,
userdata };
@@ -718,13 +718,13 @@
*/
}
-static void joined_chat(PurpleChatConversation *from, PurpleChatConversation *to,
+static void joined_chat(PurpleConversation *from, PurpleConversation *to,
int id, const char *room, gpointer userdata) {
/* tell their chat window that we joined */
purple_debug_info("nullprpl", "%s sees that %s joined chat room %s\n",
- purple_chat_conversation_get_nick(to), purple_chat_conversation_get_nick(from), room);
- purple_chat_conversation_add_user(to,
- purple_chat_conversation_get_nick(from),
+ purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(to)), purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(from)), room);
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(to),
+ purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(from)),
NULL, /* user-provided join message, IRC style */
PURPLE_CHAT_USER_NONE,
TRUE); /* show a join message */
@@ -732,9 +732,9 @@
if (from != to) {
/* add them to our chat window */
purple_debug_info("nullprpl", "%s sees that %s is in chat room %s\n",
- purple_chat_conversation_get_nick(from), purple_chat_conversation_get_nick(to), room);
- purple_chat_conversation_add_user(from,
- purple_chat_conversation_get_nick(to),
+ purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(from)), purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(to)), room);
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(from),
+ purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(to)),
NULL, /* user-provided join message, IRC style */
PURPLE_CHAT_USER_NONE,
FALSE); /* show a join message */
@@ -805,15 +805,15 @@
gint id, const gchar *message, const gchar *who)
{
const char *username = purple_account_get_username(purple_connection_get_account(gc));
- PurpleChatConversation *chat = purple_conversations_find_chat(gc, id);
- const char *room = purple_conversation_get_name(PURPLE_CONVERSATION(chat));
+ PurpleConversation *chat = purple_conversations_find_chat(gc, id);
+ const char *room = purple_conversation_get_name(chat);
PurpleAccount *to_acct = purple_accounts_find(who, "null");
purple_debug_info("nullprpl", "%s is inviting %s to join chat room %s\n",
username, who, room);
if (to_acct) {
- PurpleChatConversation *to_conv = purple_conversations_find_chat(purple_account_get_connection(to_acct), id);
+ PurpleConversation *to_conv = purple_conversations_find_chat(purple_account_get_connection(to_acct), id);
if (to_conv) {
char *tmp = g_strdup_printf("%s is already in chat room %s.", who, room);
purple_debug_info("nullprpl",
@@ -821,7 +821,7 @@
"ignoring invitation from %s\n",
who, room, username);
purple_notify_info(gc, _("Chat invitation"), _("Chat invitation"), tmp,
- purple_request_cpar_from_conversation(PURPLE_CONVERSATION(to_conv)));
+ purple_request_cpar_from_conversation(to_conv));
g_free(tmp);
} else {
GHashTable *components;
@@ -833,14 +833,14 @@
}
}
-static void left_chat_room(PurpleChatConversation *from, PurpleChatConversation *to,
+static void left_chat_room(PurpleConversation *from, PurpleConversation *to,
int id, const char *room, gpointer userdata) {
if (from != to) {
/* tell their chat window that we left */
purple_debug_info("nullprpl", "%s sees that %s left chat room %s\n",
- purple_chat_conversation_get_nick(to), purple_chat_conversation_get_nick(from), room);
- purple_chat_conversation_remove_user(to,
- purple_chat_conversation_get_nick(from),
+ purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(to)), purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(from)), room);
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(to),
+ purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(from)),
NULL); /* user-provided message, IRC style */
}
}
@@ -849,24 +849,24 @@
null_chat_leave(PurpleProtocolChat *protocol_chat, PurpleConnection *gc,
gint id)
{
- PurpleChatConversation *chat = purple_conversations_find_chat(gc, id);
+ PurpleConversation *chat = purple_conversations_find_chat(gc, id);
purple_debug_info("nullprpl", "%s is leaving chat room %s\n",
purple_account_get_username(purple_connection_get_account(gc)),
- purple_conversation_get_name(PURPLE_CONVERSATION(chat)));
+ purple_conversation_get_name(chat));
/* tell everyone that we left */
foreach_gc_in_chat(left_chat_room, gc, id, NULL);
}
-static void receive_chat_message(PurpleChatConversation *from, PurpleChatConversation *to,
+static void receive_chat_message(PurpleConversation *from, PurpleConversation *to,
int id, const char *room, gpointer userdata) {
const char *message = (const char *)userdata;
- PurpleConnection *to_gc = get_null_gc(purple_chat_conversation_get_nick(to));
+ PurpleConnection *to_gc = get_null_gc(purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(to)));
purple_debug_info("nullprpl",
"%s receives message from %s in chat room %s: %s\n",
- purple_chat_conversation_get_nick(to), purple_chat_conversation_get_nick(from), room, message);
- purple_serv_got_chat_in(to_gc, id, purple_chat_conversation_get_nick(from), PURPLE_MESSAGE_RECV, message,
+ purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(to)), purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(from)), room, message);
+ purple_serv_got_chat_in(to_gc, id, purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(from)), PURPLE_MESSAGE_RECV, message,
time(NULL));
}
@@ -875,13 +875,13 @@
gint id, PurpleMessage *msg)
{
const char *username = purple_account_get_username(purple_connection_get_account(gc));
- PurpleChatConversation *chat = purple_conversations_find_chat(gc, id);
+ PurpleConversation *chat = purple_conversations_find_chat(gc, id);
const gchar *message = purple_message_get_contents(msg);
if (chat) {
purple_debug_info("nullprpl",
"%s is sending message to chat room %s: %s\n", username,
- purple_conversation_get_name(PURPLE_CONVERSATION(chat)), message);
+ purple_conversation_get_name(chat), message);
/* send message to everyone in the chat room */
foreach_gc_in_chat(receive_chat_message, gc, id, (gpointer)message);
@@ -966,21 +966,20 @@
}
-static void set_chat_topic_fn(PurpleChatConversation *from, PurpleChatConversation *to,
+static void set_chat_topic_fn(PurpleConversation *from, PurpleConversation *to,
int id, const char *room, gpointer userdata) {
const char *topic = (const char *)userdata;
const char *username = purple_account_get_username(purple_conversation_get_account(PURPLE_CONVERSATION(from)));
char *msg;
- purple_chat_conversation_set_topic(to, username, topic);
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(to), username, topic);
if (topic && *topic)
msg = g_strdup_printf(_("%s sets topic to: %s"), username, topic);
else
msg = g_strdup_printf(_("%s clears topic"), username);
- purple_conversation_write_system_message(PURPLE_CONVERSATION(to),
- msg, PURPLE_MESSAGE_NO_LOG);
+ purple_conversation_write_system_message(to, msg, PURPLE_MESSAGE_NO_LOG);
g_free(msg);
}
@@ -988,7 +987,7 @@
null_set_chat_topic(PurpleProtocolChat *protocol_chat, PurpleConnection *gc,
gint id, const gchar *topic)
{
- PurpleChatConversation *chat = purple_conversations_find_chat(gc, id);
+ PurpleConversation *chat = purple_conversations_find_chat(gc, id);
const char *last_topic;
if (!chat)
@@ -996,9 +995,9 @@
purple_debug_info("nullprpl", "%s sets topic of chat room '%s' to '%s'\n",
purple_account_get_username(purple_connection_get_account(gc)),
- purple_conversation_get_name(PURPLE_CONVERSATION(chat)), topic);
+ purple_conversation_get_name(chat), topic);
- last_topic = purple_chat_conversation_get_topic(chat);
+ last_topic = purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(chat));
if (purple_strequal(topic, last_topic))
return; /* topic is unchanged, this is a noop */
--- a/libpurple/protocols/sametime/sametime.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/sametime/sametime.c Tue May 18 02:04:53 2021 -0500
@@ -292,7 +292,7 @@
static void convo_features(struct mwConversation *conv);
-static PurpleIMConversation *convo_get_im(struct mwConversation *conv);
+static PurpleConversation *convo_get_im(struct mwConversation *conv);
/* name and id */
@@ -1771,7 +1771,7 @@
const char *text) {
struct mwPurpleProtocolData *pd;
PurpleAccount *acct;
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleBuddy *buddy;
char *who = from->user_id;
char *msg, *msg2;
@@ -1791,7 +1791,7 @@
else
msg2 = g_strdup(who);
- purple_conversation_write_system_message(PURPLE_CONVERSATION(im), msg2, 0);
+ purple_conversation_write_system_message(im, msg2, 0);
g_free(who);
g_free(msg);
g_free(msg2);
@@ -1919,7 +1919,7 @@
struct mwSession *session;
struct mwPurpleProtocolData *pd;
PurpleConnection *gc;
- PurpleChatConversation *g_conf;
+ PurpleConversation *g_conf;
const char *n = mwConference_getName(conf);
const char *t = mwConference_getTitle(conf);
@@ -1938,7 +1938,7 @@
for(; members; members = members->next) {
struct mwLoginInfo *peer = members->data;
- purple_chat_conversation_add_user(g_conf, peer->user_id,
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(g_conf), peer->user_id,
NULL, PURPLE_CHAT_USER_NONE, FALSE);
}
}
@@ -2452,7 +2452,7 @@
}
-static PurpleIMConversation *convo_get_im(struct mwConversation *conv) {
+static PurpleConversation *convo_get_im(struct mwConversation *conv) {
struct mwServiceIm *srvc;
struct mwSession *session;
struct mwPurpleProtocolData *pd;
@@ -2503,7 +2503,7 @@
/* Does what it takes to get an error displayed for a conversation */
static void convo_error(struct mwConversation *conv, guint32 err) {
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleConnection *pc;
char *tmp, *text;
struct mwIdBlock *idb;
@@ -2515,13 +2515,12 @@
im = convo_get_im(conv);
if(im && !purple_conversation_present_error(idb->user,
- purple_conversation_get_account(PURPLE_CONVERSATION(im)), text)) {
+ purple_conversation_get_account(im), text)) {
g_free(text);
text = g_strdup_printf(_("Unable to send message to %s:"),
(idb->user)? idb->user: "(unknown)");
- pc = purple_account_get_connection(purple_conversation_get_account(
- PURPLE_CONVERSATION(im)));
+ pc = purple_account_get_connection(purple_conversation_get_account(im));
purple_notify_error(pc, NULL, text, tmp, purple_request_cpar_from_connection(pc));
}
@@ -2553,17 +2552,16 @@
inform the purple conversation that it's unsafe to offer any *cool*
features. */
static void convo_nofeatures(struct mwConversation *conv) {
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleConnection *gc;
im = convo_get_im(conv);
if(! im) return;
- gc = purple_conversation_get_connection(PURPLE_CONVERSATION(im));
+ gc = purple_conversation_get_connection(im);
if(! gc) return;
- purple_conversation_set_features(PURPLE_CONVERSATION(im),
- purple_connection_get_flags(gc));
+ purple_conversation_set_features(im, purple_connection_get_flags(gc));
}
@@ -2571,13 +2569,13 @@
to inform the purple conversation of what features to offer the
user */
static void convo_features(struct mwConversation *conv) {
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleConnectionFlags feat;
im = convo_get_im(conv);
if(! im) return;
- feat = purple_conversation_get_features(PURPLE_CONVERSATION(im));
+ feat = purple_conversation_get_features(im);
if(mwConversation_isOpen(conv)) {
if(mwConversation_supports(conv, mwImSend_HTML)) {
@@ -2593,7 +2591,7 @@
}
DEBUG_INFO("conversation features set to 0x%04x\n", feat);
- purple_conversation_set_features(PURPLE_CONVERSATION(im), feat);
+ purple_conversation_set_features(im, feat);
} else {
convo_nofeatures(conv);
@@ -2872,7 +2870,7 @@
struct mwSession *session;
struct mwPurpleProtocolData *pd;
PurpleConnection *gc;
- PurpleChatConversation *gconf;
+ PurpleConversation *gconf;
GList *members, *l;
@@ -2896,7 +2894,7 @@
for(l = members; l; l = l->next) {
struct mwIdBlock *idb = l->data;
- purple_chat_conversation_add_user(gconf, idb->user,
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(gconf), idb->user,
NULL, PURPLE_CHAT_USER_NONE, FALSE);
}
g_list_free(members);
@@ -4039,14 +4037,14 @@
static void notify_im(PurpleConnection *gc, GList *row, void *user_data) {
PurpleAccount *acct;
- PurpleIMConversation *im;
+ PurpleConversation *im;
char *id;
acct = purple_connection_get_account(gc);
id = g_list_nth_data(row, 1);
im = purple_conversations_find_im_with_account(id, acct);
if(! im) im = purple_im_conversation_new(acct, id);
- purple_conversation_present(PURPLE_CONVERSATION(im));
+ purple_conversation_present(im);
}
--- a/libpurple/protocols/silc/buddy.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/silc/buddy.c Tue May 18 02:04:53 2021 -0500
@@ -76,7 +76,7 @@
switch (status) {
case SILC_KEY_AGREEMENT_OK:
{
- PurpleIMConversation *im;
+ PurpleConversation *im;
char tmp[128];
/* Set the private key for this client */
@@ -99,7 +99,7 @@
client_entry->nickname);
}
g_snprintf(tmp, sizeof(tmp), "%s [private key]", client_entry->nickname);
- purple_conversation_set_title(PURPLE_CONVERSATION(im), tmp);
+ purple_conversation_set_title(im, tmp);
}
break;
--- a/libpurple/protocols/silc/ops.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/silc/ops.c Tue May 18 02:04:53 2021 -0500
@@ -94,7 +94,7 @@
const unsigned char *data;
SilcUInt32 data_len;
PurpleMessageFlags cflags = 0;
- PurpleChatConversation *chat = NULL;
+ PurpleConversation *chat = NULL;
SilcBool ret = FALSE;
if (!mime)
@@ -218,7 +218,7 @@
if (channel) {
purple_serv_got_chat_in(gc,
- purple_chat_conversation_get_id(chat),
+ purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)),
sender->nickname, cflags, tmp, time(NULL));
} else {
purple_serv_got_im(gc, sender->nickname,
@@ -263,7 +263,7 @@
{
PurpleConnection *gc = client->application;
SilcPurple sg = purple_connection_get_protocol_data(gc);
- PurpleChatConversation *chat = NULL;
+ PurpleConversation *chat = NULL;
char *msg, *tmp;
if (!message)
@@ -309,7 +309,7 @@
tmp = g_markup_escape_text(msg, -1);
/* Send to Purple */
- purple_serv_got_chat_in(gc, purple_chat_conversation_get_id(chat),
+ purple_serv_got_chat_in(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)),
sender->nickname, PURPLE_MESSAGE_RECV, tmp, time(NULL));
g_free(tmp);
g_free(msg);
@@ -338,7 +338,7 @@
}
tmp = g_markup_escape_text(msg, -1);
/* Send to Purple */
- purple_serv_got_chat_in(gc, purple_chat_conversation_get_id(chat),
+ purple_serv_got_chat_in(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)),
sender->nickname, PURPLE_MESSAGE_RECV, tmp, time(NULL));
g_free(salvaged);
g_free(tmp);
@@ -443,7 +443,7 @@
PurpleConnection *gc = client->application;
SilcPurple sg = purple_connection_get_protocol_data(gc);
PurpleAccount *account = purple_connection_get_account(gc);
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
SilcClientEntry client_entry, client_entry2;
SilcChannelEntry channel;
SilcServerEntry server_entry;
@@ -494,7 +494,7 @@
/* Join user to channel */
g_snprintf(buf, sizeof(buf), "%s@%s",
client_entry->username, client_entry->hostname);
- purple_chat_conversation_add_user(chat,
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(chat),
client_entry->nickname, buf, PURPLE_CHAT_USER_NONE, TRUE);
break;
@@ -509,7 +509,7 @@
break;
/* Remove user from channel */
- purple_chat_conversation_remove_user(chat,
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(chat),
client_entry->nickname, NULL);
break;
@@ -525,7 +525,7 @@
chu->channel->channel_name, sg->account);
if (!chat)
continue;
- purple_chat_conversation_remove_user(chat,
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(chat),
client_entry->nickname,
tmp);
}
@@ -560,7 +560,7 @@
client_entry->nickname, channel->channel_name, tmp2);
purple_conversation_write_system_message(
PURPLE_CONVERSATION(chat), buf, 0);
- purple_chat_conversation_set_topic(chat,
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat),
client_entry->nickname, tmp);
} else if (idtype == SILC_ID_SERVER) {
server_entry = (SilcServerEntry)entry;
@@ -569,7 +569,7 @@
server_entry->server_name, channel->channel_name, tmp2);
purple_conversation_write_system_message(
PURPLE_CONVERSATION(chat), buf, 0);
- purple_chat_conversation_set_topic(chat,
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat),
server_entry->server_name, tmp);
} else if (idtype == SILC_ID_CHANNEL) {
channel = (SilcChannelEntry)entry;
@@ -578,10 +578,10 @@
channel->channel_name, channel->channel_name, tmp2);
purple_conversation_write_system_message(
PURPLE_CONVERSATION(chat), buf, 0);
- purple_chat_conversation_set_topic(chat,
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat),
channel->channel_name, tmp);
} else {
- purple_chat_conversation_set_topic(chat, NULL, tmp);
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat), NULL, tmp);
}
g_free(tmp2);
@@ -604,8 +604,8 @@
chu->channel->channel_name, sg->account);
if (!chat)
continue;
- if (purple_chat_conversation_has_user(chat, client_entry->nickname))
- purple_chat_conversation_rename_user(chat,
+ if (purple_chat_conversation_has_user(PURPLE_CHAT_CONVERSATION(chat), client_entry->nickname))
+ purple_chat_conversation_rename_user(PURPLE_CHAT_CONVERSATION(chat),
tmp, name);
}
silc_hash_table_list_reset(&htl);
@@ -687,9 +687,9 @@
_("<I>%s</I> removed all <I>%s's</I> modes"), name,
client_entry2->nickname);
}
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), buf, 0);
+ purple_conversation_write_system_message(chat, buf, 0);
purple_chat_user_set_flags(purple_chat_conversation_find_user(
- chat, client_entry2->nickname), flags);
+ PURPLE_CHAT_CONVERSATION(chat), client_entry2->nickname), flags);
break;
}
@@ -716,14 +716,13 @@
_("You have been kicked off <I>%s</I> by <I>%s</I> (%s)"),
channel->channel_name, client_entry2->nickname,
tmp ? tmp : "");
- purple_conversation_write_system_message(PURPLE_CONVERSATION(chat),
- buf, 0);
- purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(chat));
+ purple_conversation_write_system_message(chat, buf, 0);
+ purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)));
} else {
/* Remove user from channel */
g_snprintf(buf, sizeof(buf), _("Kicked by %s (%s)"),
client_entry2->nickname, tmp ? tmp : "");
- purple_chat_conversation_remove_user(chat,
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(chat),
client_entry->nickname,
buf);
}
@@ -761,9 +760,8 @@
chu->channel->channel_name, sg->account);
if (!chat)
continue;
- purple_conversation_write_system_message(
- PURPLE_CONVERSATION(chat), buf, 0);
- purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(chat));
+ purple_conversation_write_system_message(chat, buf, 0);
+ purple_serv_got_chat_left(gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat)));
}
silc_hash_table_list_reset(&htl);
@@ -792,7 +790,7 @@
chu->channel->channel_name, sg->account);
if (!chat)
continue;
- purple_chat_conversation_remove_user(chat,
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(chat),
client_entry->nickname, tmp);
}
silc_hash_table_list_reset(&htl);
@@ -816,7 +814,7 @@
chu->channel->channel_name, sg->account);
if (!chat)
continue;
- purple_chat_conversation_remove_user(chat,
+ purple_chat_conversation_remove_user(PURPLE_CHAT_CONVERSATION(chat),
client_entry->nickname,
_("Server signoff"));
}
@@ -987,13 +985,12 @@
{
PurpleConnection *gc = client->application;
SilcPurple sg = purple_connection_get_protocol_data(gc);
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
switch (command) {
case SILC_COMMAND_JOIN:
{
SilcChannelEntry channel;
- PurpleChatConversation *chat;
SilcHashTableList *user_list;
SilcChannelUser chu;
GList *users = NULL, *flags = NULL;
@@ -1042,21 +1039,24 @@
_("Channel founder on <I>%s</I> is <I>%s</I>"),
channel->channel_name, chu->client->nickname);
- purple_conversation_write_system_message(
- PURPLE_CONVERSATION(chat), tmp, 0);
+ purple_conversation_write_system_message(chat, tmp, 0);
}
}
- purple_chat_conversation_add_users(chat, users, NULL, flags, FALSE);
+ purple_chat_conversation_add_users(PURPLE_CHAT_CONVERSATION(chat),
+ users, NULL, flags, FALSE);
g_list_free(users);
g_list_free(flags);
/* Set topic */
- if (topic)
- purple_chat_conversation_set_topic(chat, NULL, topic);
+ if(topic) {
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat),
+ NULL, topic);
+ }
/* Set nick */
- purple_chat_conversation_set_nick(chat, conn->local_entry->nickname);
+ purple_chat_conversation_set_nick(PURPLE_CHAT_CONVERSATION(chat),
+ conn->local_entry->nickname);
}
break;
@@ -1315,8 +1315,10 @@
}
/* Set topic */
- if (channel->topic)
- purple_chat_conversation_set_topic(chat, NULL, channel->topic);
+ if (channel->topic) {
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(chat),
+ NULL, channel->topic);
+ }
}
break;
@@ -1344,14 +1346,14 @@
chu->channel->channel_name, sg->account);
if (!chat)
continue;
- oldnick = purple_chat_conversation_get_nick(chat);
+ oldnick = purple_chat_conversation_get_nick(PURPLE_CHAT_CONVERSATION(chat));
if (!purple_strequal(oldnick,
- purple_normalize(purple_conversation_get_account
- (PURPLE_CONVERSATION(chat)), newnick))) {
+ purple_normalize(purple_conversation_get_account(chat),
+ newnick))) {
- purple_chat_conversation_rename_user(chat,
+ purple_chat_conversation_rename_user(PURPLE_CHAT_CONVERSATION(chat),
oldnick, newnick);
- purple_chat_conversation_set_nick(chat, newnick);
+ purple_chat_conversation_set_nick(PURPLE_CHAT_CONVERSATION(chat), newnick);
}
}
silc_hash_table_list_reset(&htl);
--- a/libpurple/protocols/silc/silc.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/silc/silc.c Tue May 18 02:04:53 2021 -0500
@@ -1397,7 +1397,7 @@
PurpleConnection *gc = client->application;
SilcPurple sg = purple_connection_get_protocol_data(gc);
SilcPurpleIM im = context;
- PurpleIMConversation *convo;
+ PurpleConversation *convo;
char tmp[256];
SilcClientEntry client_entry;
SilcDList list;
@@ -1445,7 +1445,7 @@
silc_buffer_len(buf));
silc_mime_partial_free(list);
msg = purple_message_new_outgoing(me, conn->local_entry->nickname, im->message, 0);
- purple_conversation_write_message(PURPLE_CONVERSATION(convo), msg);
+ purple_conversation_write_message(convo, msg);
g_object_unref(G_OBJECT(msg));
goto out;
}
@@ -1455,7 +1455,7 @@
silc_client_send_private_message(client, conn, client_entry, im->flags,
sg->sha1hash, (unsigned char *)im->message, im->message_len);
msg = purple_message_new_outgoing(me, conn->local_entry->nickname, im->message, 0);
- purple_conversation_write_message(PURPLE_CONVERSATION(convo), msg);
+ purple_conversation_write_message(convo, msg);
g_object_unref(G_OBJECT(msg));
goto out;
@@ -1463,7 +1463,7 @@
g_snprintf(tmp, sizeof(tmp),
_("User <I>%s</I> is not present in the network"), im->nick);
purple_conversation_write_system_message(
- PURPLE_CONVERSATION(convo), tmp, 0);
+ convo, tmp, 0);
out:
if (free_list) {
@@ -1593,7 +1593,7 @@
const char *cmd, char **args, char **error, void *data)
{
PurpleConnection *gc;
- PurpleChatConversation *chat = PURPLE_CHAT_CONVERSATION(conv);
+ PurpleConversation *chat = conv;
int id = 0;
gc = purple_conversation_get_connection(conv);
@@ -1606,7 +1606,7 @@
purple_connection_get_account(gc));
if (chat != NULL)
- id = purple_chat_conversation_get_id(chat);
+ id = purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(chat));
if (id == 0)
return PURPLE_CMD_RET_FAILED;
@@ -1731,7 +1731,7 @@
const char *cmd, char **args, char **error, void *data)
{
int ret = 1;
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleConnection *gc;
PurpleAccount *account;
@@ -1755,7 +1755,7 @@
me, args[0], args[1], 0);
ret = silcpurple_send_im(NULL, gc, msg);
- purple_conversation_write_message(PURPLE_CONVERSATION(im), msg);
+ purple_conversation_write_message(im, msg);
g_object_unref(G_OBJECT(msg));
}
--- a/libpurple/protocols/zephyr/zephyr.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/protocols/zephyr/zephyr.c Tue May 18 02:04:53 2021 -0500
@@ -311,7 +311,7 @@
zephyr_triple *zt;
gchar *send_inst_utf8;
GSList *l = g_slist_find_custom(zephyr->subscrips, &sub, (GCompareFunc)zephyr_triple_subset);
- PurpleChatConversation *gcc;
+ PurpleConversation *gcc;
if (!l) {
/* This is a server supplied subscription */
@@ -338,7 +338,7 @@
}
gcc = purple_conversations_find_chat_with_account(zt->name, purple_connection_get_account(gc));
- if (!purple_chat_conversation_has_user(gcc, stripped_sender)) {
+ if (!purple_chat_conversation_has_user(PURPLE_CHAT_CONVERSATION(gcc), stripped_sender)) {
GInetAddress *inet_addr = NULL;
gchar *ipaddr = NULL;
@@ -346,7 +346,8 @@
(const guint8 *)&notice->z_sender_addr,
G_SOCKET_FAMILY_IPV4);
ipaddr = g_inet_address_to_string(inet_addr);
- purple_chat_conversation_add_user(gcc, stripped_sender, ipaddr,
+ purple_chat_conversation_add_user(PURPLE_CHAT_CONVERSATION(gcc),
+ stripped_sender, ipaddr,
PURPLE_CHAT_USER_NONE, TRUE);
g_free(ipaddr);
g_object_unref(inet_addr);
@@ -919,7 +920,7 @@
GSList *l;
zephyr_triple *zt;
const char *sig;
- PurpleChatConversation *gcc;
+ PurpleConversation *gcc;
char *inst;
char *recipient;
zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
@@ -935,7 +936,7 @@
gcc = purple_conversations_find_chat_with_account(zt->name, purple_connection_get_account(gc));
- if (!(inst = (char *)purple_chat_conversation_get_topic(gcc)))
+ if (!(inst = (char *)purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(gcc))))
inst = g_strdup("PERSONAL");
if (!g_ascii_strcasecmp(zt->sub.zsub_recipient, "*")) {
@@ -1349,7 +1350,7 @@
static void zephyr_chat_set_topic(PurpleConnection * gc, int id, const char *topic)
{
zephyr_triple *zt;
- PurpleChatConversation *gcc;
+ PurpleConversation *gcc;
gchar *topic_utf8;
zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
GSList *l;
@@ -1363,7 +1364,7 @@
gcc = purple_conversations_find_chat_with_account(zt->name, purple_connection_get_account(gc));
topic_utf8 = convert_to_utf8(topic, zephyr->encoding);
- purple_chat_conversation_set_topic(gcc, zephyr->username, topic_utf8);
+ purple_chat_conversation_set_topic(PURPLE_CHAT_CONVERSATION(gcc), zephyr->username, topic_utf8);
g_free(topic_utf8);
}
--- a/libpurple/purplechatconversation.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/purplechatconversation.c Tue May 18 02:04:53 2021 -0500
@@ -338,9 +338,9 @@
/******************************************************************************
* Public API
*****************************************************************************/
-PurpleChatConversation *
+PurpleConversation *
purple_chat_conversation_new(PurpleAccount *account, const gchar *name) {
- PurpleChatConversation *chat = NULL;
+ PurpleConversation *chat = NULL;
PurpleConnection *connection = NULL;
g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
@@ -349,7 +349,7 @@
/* Check if this conversation already exists. */
chat = purple_conversations_find_chat_with_account(name, account);
if(PURPLE_IS_CHAT_CONVERSATION(chat)) {
- if(!purple_chat_conversation_has_left(chat)) {
+ if(!purple_chat_conversation_has_left(PURPLE_CHAT_CONVERSATION(chat))) {
purple_debug_warning("chat-conversation", "A chat named %s "
"already exists.", name);
return NULL;
@@ -364,7 +364,7 @@
return NULL;
}
- return PURPLE_CHAT_CONVERSATION(g_object_new(
+ return PURPLE_CONVERSATION(g_object_new(
PURPLE_TYPE_CHAT_CONVERSATION,
"account", account,
"name", name,
--- a/libpurple/purplechatconversation.h Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/purplechatconversation.h Tue May 18 02:04:53 2021 -0500
@@ -88,7 +88,7 @@
*
* Returns: The new conversation.
*/
-PurpleChatConversation *purple_chat_conversation_new(PurpleAccount *account, const gchar *name);
+PurpleConversation *purple_chat_conversation_new(PurpleAccount *account, const gchar *name);
/**
* purple_chat_conversation_get_users:
--- a/libpurple/purpleimconversation.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/purpleimconversation.c Tue May 18 02:04:53 2021 -0500
@@ -248,10 +248,10 @@
/******************************************************************************
* Public API
*****************************************************************************/
-PurpleIMConversation *
+PurpleConversation *
purple_im_conversation_new(PurpleAccount *account, const char *name)
{
- PurpleIMConversation *im = NULL;
+ PurpleConversation *im = NULL;
g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
g_return_val_if_fail(name != NULL, NULL);
--- a/libpurple/purpleimconversation.h Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/purpleimconversation.h Tue May 18 02:04:53 2021 -0500
@@ -101,7 +101,7 @@
*
* Returns: The new conversation.
*/
-PurpleIMConversation *purple_im_conversation_new(PurpleAccount *account, const gchar *name);
+PurpleConversation *purple_im_conversation_new(PurpleAccount *account, const gchar *name);
/**
* purple_im_conversation_set_icon:
--- a/libpurple/server.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/server.c Tue May 18 02:04:53 2021 -0500
@@ -123,7 +123,7 @@
int purple_serv_send_im(PurpleConnection *gc, PurpleMessage *msg)
{
- PurpleIMConversation *im = NULL;
+ PurpleConversation *im = NULL;
PurpleAccount *account = NULL;
PurplePresence *presence = NULL;
PurpleProtocol *protocol = NULL;
@@ -169,8 +169,8 @@
lar->sent = time(NULL);
}
- if(im && purple_im_conversation_get_send_typed_timeout(im))
- purple_im_conversation_stop_send_typed_timeout(im);
+ if(im && purple_im_conversation_get_send_typed_timeout(PURPLE_IM_CONVERSATION(im)))
+ purple_im_conversation_stop_send_typed_timeout(PURPLE_IM_CONVERSATION(im));
return val;
}
@@ -241,7 +241,7 @@
PurpleAccount *account;
GSList *buddies;
PurpleBuddy *b;
- PurpleIMConversation *im;
+ PurpleConversation *im;
account = purple_connection_get_account(gc);
buddies = purple_blist_find_buddies(account, who);
@@ -269,7 +269,7 @@
escaped, escaped2);
purple_conversation_write_system_message(
- PURPLE_CONVERSATION(im), tmp,
+ im, tmp,
PURPLE_MESSAGE_NO_LINKIFY);
g_free(tmp);
@@ -440,7 +440,7 @@
void purple_serv_chat_invite(PurpleConnection *gc, int id, const char *message, const char *name)
{
PurpleProtocol *protocol = NULL;
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
char *buffy;
chat = purple_conversations_find_chat(gc, id);
@@ -502,7 +502,7 @@
PurpleMessageFlags flags, time_t mtime)
{
PurpleAccount *account;
- PurpleIMConversation *im;
+ PurpleConversation *im;
char *message, *name;
char *angel, *buffy;
int plugin_return;
@@ -569,7 +569,7 @@
im = purple_im_conversation_new(account, name);
pmsg = purple_message_new_incoming(name, message, flags, mtime);
- purple_conversation_write_message(PURPLE_CONVERSATION(im), pmsg);
+ purple_conversation_write_message(im, pmsg);
g_free(message);
g_object_unref(G_OBJECT(pmsg));
@@ -657,11 +657,17 @@
void purple_serv_got_typing(PurpleConnection *gc, const char *name, int timeout,
PurpleIMTypingState state) {
- PurpleIMConversation *im;
+ PurpleConversation *conv;
+
+ conv = purple_conversations_find_im_with_account(name, purple_connection_get_account(gc));
+ if(PURPLE_IS_IM_CONVERSATION(conv)) {
+ PurpleIMConversation *im = PURPLE_IM_CONVERSATION(conv);
- im = purple_conversations_find_im_with_account(name, purple_connection_get_account(gc));
- if (im != NULL) {
purple_im_conversation_set_typing_state(im, state);
+
+ if(timeout > 0) {
+ purple_im_conversation_start_typing_timeout(im, timeout);
+ }
} else {
switch (state)
{
@@ -679,18 +685,16 @@
break;
}
}
-
- if (im != NULL && timeout > 0)
- purple_im_conversation_start_typing_timeout(im, timeout);
}
void purple_serv_got_typing_stopped(PurpleConnection *gc, const char *name) {
- PurpleIMConversation *im;
+ PurpleConversation *conv;
- im = purple_conversations_find_im_with_account(name, purple_connection_get_account(gc));
- if (im != NULL)
+ conv = purple_conversations_find_im_with_account(name, purple_connection_get_account(gc));
+ if (conv != NULL)
{
+ PurpleIMConversation *im = PURPLE_IM_CONVERSATION(conv);
if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_NOT_TYPING)
return;
@@ -788,10 +792,10 @@
chat_invite_reject(cid);
}
-PurpleChatConversation *purple_serv_got_joined_chat(PurpleConnection *gc,
+PurpleConversation *purple_serv_got_joined_chat(PurpleConnection *gc,
int id, const char *name)
{
- PurpleChatConversation *chat;
+ PurpleConversation *chat;
PurpleAccount *account;
account = purple_connection_get_account(gc);
@@ -803,9 +807,9 @@
g_return_val_if_fail(chat != NULL, NULL);
if (!g_slist_find(purple_connection_get_active_chats(gc), chat))
- _purple_connection_add_active_chat(gc, chat);
+ _purple_connection_add_active_chat(gc, PURPLE_CHAT_CONVERSATION(chat));
- purple_chat_conversation_set_id(chat, id);
+ purple_chat_conversation_set_id(PURPLE_CHAT_CONVERSATION(chat), id);
purple_signal_emit(purple_conversations_get_handle(), "chat-joined", chat);
--- a/libpurple/server.h Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/server.h Tue May 18 02:04:53 2021 -0500
@@ -42,6 +42,7 @@
#include "group.h"
#include "protocols.h"
#include "purpleattentiontype.h"
+#include "purpleimconversation.h"
#include "purplemessage.h"
G_BEGIN_DECLS
@@ -330,7 +331,7 @@
*
* Returns: (transfer none): The resulting conversation.
*/
-PurpleChatConversation *purple_serv_got_joined_chat(PurpleConnection *gc,
+PurpleConversation *purple_serv_got_joined_chat(PurpleConnection *gc,
int id, const char *name);
/**
* purple_serv_got_join_chat_failed:
--- a/libpurple/xfer.c Mon May 17 20:32:56 2021 -0500
+++ b/libpurple/xfer.c Tue May 18 02:04:53 2021 -0500
@@ -211,7 +211,7 @@
purple_xfer_conversation_write_internal(PurpleXfer *xfer,
const char *message, gboolean is_error, gboolean print_thumbnail)
{
- PurpleIMConversation *im = NULL;
+ PurpleConversation *im = NULL;
PurpleMessageFlags flags = PURPLE_MESSAGE_SYSTEM;
char *escaped;
gconstpointer thumbnail_data;
@@ -243,11 +243,11 @@
message_with_img = g_strdup_printf("<img src=\""
PURPLE_IMAGE_STORE_PROTOCOL "%u\"> %s", id, escaped);
purple_conversation_write_system_message(
- PURPLE_CONVERSATION(im), message_with_img, flags);
+ im, message_with_img, flags);
g_free(message_with_img);
} else {
purple_conversation_write_system_message(
- PURPLE_CONVERSATION(im), escaped, flags);
+ im, escaped, flags);
}
g_free(escaped);
}
@@ -955,7 +955,7 @@
if (completed == TRUE) {
char *msg = NULL;
- PurpleIMConversation *im;
+ PurpleConversation *im;
purple_xfer_set_status(xfer, PURPLE_XFER_STATUS_DONE);
@@ -983,7 +983,7 @@
if (im != NULL) {
purple_conversation_write_system_message(
- PURPLE_CONVERSATION(im), msg, 0);
+ im, msg, 0);
}
g_free(msg);
}
--- a/pidgin/gtkblist.c Mon May 17 20:32:56 2021 -0500
+++ b/pidgin/gtkblist.c Tue May 18 02:04:53 2021 -0500
@@ -3290,6 +3290,7 @@
if (bnode && bnode->conv.conv) {
conv = PURPLE_CHAT_CONVERSATION(bnode->conv.conv);
} else {
+ PurpleConversation *chat_conv;
char *chat_name;
if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, get_name)) {
chat_name = purple_protocol_chat_get_name(PURPLE_PROTOCOL_CHAT(protocol),
@@ -3298,9 +3299,13 @@
chat_name = g_strdup(purple_chat_get_name(chat));
}
- conv = purple_conversations_find_chat_with_account(chat_name,
- account);
+ chat_conv = purple_conversations_find_chat_with_account(chat_name,
+ account);
g_free(chat_name);
+
+ if(PURPLE_IS_CHAT_CONVERSATION(chat_conv)) {
+ conv = PURPLE_CHAT_CONVERSATION(chat_conv);
+ }
}
if (conv && !purple_chat_conversation_has_left(conv)) {
@@ -6123,7 +6128,7 @@
PurpleAccount *account;
PurpleGroup *g;
PurpleBuddy *b;
- PurpleIMConversation *im;
+ PurpleConversation *im;
PurpleBuddyIcon *icon;
if (resp == GTK_RESPONSE_OK)
@@ -6184,7 +6189,7 @@
im = purple_conversations_find_im_with_account(who, data->rq_data.account);
if (im != NULL) {
- icon = purple_im_conversation_get_icon(im);
+ icon = purple_im_conversation_get_icon(PURPLE_IM_CONVERSATION(im));
if (icon != NULL)
purple_buddy_icon_update(icon);
}
--- a/pidgin/gtkconv.c Mon May 17 20:32:56 2021 -0500
+++ b/pidgin/gtkconv.c Tue May 18 02:04:53 2021 -0500
@@ -1678,13 +1678,13 @@
{
PurpleAccount *account = g_object_get_data(m, "purple_account");
gchar *name = g_object_get_data(m, "purple_buddy_name");
- PurpleIMConversation *im;
+ PurpleConversation *im;
if (gtk_check_menu_item_get_active((GtkCheckMenuItem*) m) == FALSE)
return;
im = purple_im_conversation_new(account, name);
- pidgin_conv_switch_active_conversation(PURPLE_CONVERSATION(im));
+ pidgin_conv_switch_active_conversation(im);
}
static void
@@ -3282,10 +3282,10 @@
cn = PURPLE_BLIST_NODE(c);
for (bn = purple_blist_node_get_first_child(cn); bn; bn = purple_blist_node_get_sibling_next(bn)) {
PurpleBuddy *b = PURPLE_BUDDY(bn);
- PurpleIMConversation *im;
+ PurpleConversation *im;
if ((im = purple_conversations_find_im_with_account(purple_buddy_get_name(b), purple_buddy_get_account(b)))) {
- if (PIDGIN_CONVERSATION(PURPLE_CONVERSATION(im)))
- return PIDGIN_CONVERSATION(PURPLE_CONVERSATION(im));
+ if (PIDGIN_CONVERSATION(im))
+ return PIDGIN_CONVERSATION(im);
}
}
@@ -4493,10 +4493,10 @@
for (; node; node = node->next)
{
PurpleBuddy *buddy = (PurpleBuddy*)node;
- PurpleIMConversation *im;
+ PurpleConversation *im;
im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
if (im)
- return PIDGIN_CONVERSATION(PURPLE_CONVERSATION(im));
+ return PIDGIN_CONVERSATION(im);
}
return NULL;
}
@@ -4594,21 +4594,21 @@
static void
update_buddy_idle_changed(PurpleBuddy *buddy, gboolean old, gboolean newidle)
{
- PurpleIMConversation *im;
+ PurpleConversation *im;
im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
if (im)
- pidgin_conv_update_fields(PURPLE_CONVERSATION(im), PIDGIN_CONV_TAB_ICON);
+ pidgin_conv_update_fields(im, PIDGIN_CONV_TAB_ICON);
}
static void
update_buddy_icon(PurpleBuddy *buddy)
{
- PurpleIMConversation *im;
+ PurpleConversation *im;
im = purple_conversations_find_im_with_account(purple_buddy_get_name(buddy), purple_buddy_get_account(buddy));
if (im)
- pidgin_conv_update_fields(PURPLE_CONVERSATION(im), PIDGIN_CONV_BUDDY_ICON);
+ pidgin_conv_update_fields(im, PIDGIN_CONV_BUDDY_ICON);
}
static void
--- a/pidgin/gtkdialogs.c Mon May 17 20:32:56 2021 -0500
+++ b/pidgin/gtkdialogs.c Tue May 18 02:04:53 2021 -0500
@@ -321,7 +321,7 @@
void
pidgin_dialogs_im_with_user(PurpleAccount *account, const char *username)
{
- PurpleIMConversation *im;
+ PurpleConversation *im;
g_return_if_fail(account != NULL);
g_return_if_fail(username != NULL);
@@ -331,8 +331,8 @@
if (im == NULL)
im = purple_im_conversation_new(account, username);
- pidgin_conv_attach_to_conversation(PURPLE_CONVERSATION(im));
- purple_conversation_present(PURPLE_CONVERSATION(im));
+ pidgin_conv_attach_to_conversation(im);
+ purple_conversation_present(im);
}
static gboolean