gobjectification: b1aab7e6: Minor fixes to get the branch to build a...
gillux at soc.pidgin.im
gillux at soc.pidgin.im
Fri Jun 1 16:51:30 EDT 2012
----------------------------------------------------------------------
Revision: b1aab7e6765149a08e7607bf0049e1e00ef738de
Parent: 9878a016a2ef83bb7823f2de2f42f4d7e605f165
Author: gillux at soc.pidgin.im
Date: 06/01/12 14:27:21
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/b1aab7e6765149a08e7607bf0049e1e00ef738de
Changelog:
Minor fixes to get the branch to build again.
Changes against parent 9878a016a2ef83bb7823f2de2f42f4d7e605f165
patched libpurple/conversation.c
patched libpurple/conversation.h
patched libpurple/protocols/null/nullprpl.c
patched libpurple/protocols/oscar/oscar.c
patched libpurple/protocols/sametime/sametime.c
patched pidgin/gtkconv.c
-------------- next part --------------
============================================================
--- libpurple/conversation.c 23f27a63c848b3e3da01f4c1c35904d80c9976d2
+++ libpurple/conversation.c b23acd708f79800bc00e459a5a8b89f22ba34475
@@ -65,6 +65,7 @@ struct _PurpleConvChat
char *nick; /**< Your nick in this chat. */
gboolean left; /**< We left the chat and kept the window open */
+ GHashTable *users; /**< Hash table of the users in the room. */
};
/**
@@ -90,6 +91,7 @@ struct _PurpleConvChatBuddy
GHashTable *attributes; /**< A hash table of attributes about the user, such as
* real name, user at host, etc.
*/
+ gpointer ui_data; /**< The UI can put whatever it wants here. */
};
/**
@@ -2337,6 +2339,20 @@ purple_conv_chat_cb_destroy(PurpleConvCh
g_free(cb);
}
+void purple_conv_chat_cb_set_ui_data(PurpleConvChatBuddy *cb, gpointer ui_data)
+{
+ g_return_if_fail(cb != NULL);
+
+ cb->ui_data = ui_data;
+}
+
+gpointer purple_conv_chat_cb_get_ui_data(const PurpleConvChatBuddy *cb)
+{
+ g_return_val_if_fail(cb != NULL, NULL);
+
+ return cb->ui_data;
+}
+
const char *
purple_conv_chat_cb_get_name(PurpleConvChatBuddy *cb)
{
============================================================
--- libpurple/protocols/oscar/oscar.c 3d39ffeb4fa60a24de44a0a96f9e4b7baa60de67
+++ libpurple/protocols/oscar/oscar.c bced0ef7eac48fc71fc96918f68fd8bf31d6f073
@@ -752,7 +752,8 @@ oscar_login(PurpleAccount *account)
/* Set this flag based on the protocol_id rather than the username,
because that is what's tied to the get_moods prpl callback. */
if (g_str_equal(purple_account_get_protocol_id(account), "prpl-icq"))
- gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS;
+ purple_connection_set_flags(gc,
+ purple_connection_get_flags(gc) | PURPLE_CONNECTION_FLAGS_SUPPORT_MOODS);
od->default_port = purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT);
============================================================
--- libpurple/conversation.h c5fa8972c0423ab1ea8c006a0884b1423d9ae16d
+++ libpurple/conversation.h 35f3a182da604dbc57eae165c5d5b2fc9eee8c87
@@ -1311,6 +1311,25 @@ PurpleConvChatBuddy *purple_conv_chat_cb
PurpleConvChatBuddy *purple_conv_chat_cb_find(PurpleConvChat *chat, const char *name);
/**
+ * Set the UI data associated with this chat buddy.
+ *
+ * @param cb The chat buddy
+ * @param ui_data A pointer to associate with this chat buddy.
+ */
+void purple_conv_chat_cb_set_ui_data(PurpleConvChatBuddy *cb, gpointer ui_data);
+
+/**
+ * Get the UI data associated with this chat buddy.
+ *
+ * @param cb The chat buddy.
+ *
+ * @return The UI data associated with this chat buddy. This is a
+ * convenience field provided to the UIs--it is not
+ * used by the libpurple core.
+ */
+gpointer purple_conv_chat_cb_get_ui_data(const PurpleConvChatBuddy *conv);
+
+/**
* Get the name of a chat buddy
*
* @param cb The chat buddy.
============================================================
--- pidgin/gtkconv.c 466b843ed32bceee89945a74a1031bf14f5eca4c
+++ pidgin/gtkconv.c ae9c9251dbf28ca04d379ae0d1e8500a400559d0
@@ -4000,10 +4000,11 @@ deleting_chat_buddy_cb(PurpleConvChatBud
static void
deleting_chat_buddy_cb(PurpleConvChatBuddy *cb)
{
- if (cb->ui_data) {
- GtkTreeRowReference *ref = cb->ui_data;
+ GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(cb);
+
+ if (ref) {
gtk_tree_row_reference_free(ref);
- cb->ui_data = NULL;
+ purple_conv_chat_cb_set_ui_data(cb, NULL);
}
}
@@ -4015,6 +4016,7 @@ add_chat_buddy_common(PurpleConversation
PurpleConvChat *chat;
PurpleConnection *gc;
PurplePluginProtocolInfo *prpl_info;
+ GtkTreeRowReference *ref;
GtkTreeModel *tm;
GtkListStore *ls;
GtkTreePath *newpath;
@@ -4087,13 +4089,13 @@ add_chat_buddy_common(PurpleConversation
CHAT_USERS_WEIGHT_COLUMN, is_buddy ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL,
-1);
- if (cb->ui_data) {
- GtkTreeRowReference *ref = cb->ui_data;
+ ref = purple_conv_chat_cb_get_ui_data(cb);
+ if (ref) {
gtk_tree_row_reference_free(ref);
}
newpath = gtk_tree_model_get_path(tm, &iter);
- cb->ui_data = gtk_tree_row_reference_new(tm, newpath);
+ purple_conv_chat_cb_set_ui_data(cb, gtk_tree_row_reference_new(tm, newpath));
gtk_tree_path_free(newpath);
if (is_me && color)
@@ -6173,7 +6175,7 @@ static gboolean get_iter_from_chatbuddy(
static gboolean get_iter_from_chatbuddy(PurpleConvChatBuddy *cb, GtkTreeIter *iter)
{
- GtkTreeRowReference *ref = cb->ui_data;
+ GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(cb);
GtkTreePath *path;
GtkTreeModel *model;
@@ -6259,11 +6261,11 @@ pidgin_conv_chat_rename_user(PurpleConve
old_cbuddy = purple_conv_chat_cb_find(chat, old_name);
if (get_iter_from_chatbuddy(old_cbuddy, &iter)) {
- GtkTreeRowReference *ref = old_cbuddy->ui_data;
+ GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(old_cbuddy);
gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
gtk_tree_row_reference_free(ref);
- old_cbuddy->ui_data = NULL;
+ purple_conv_chat_cb_set_ui_data(old_cbuddy, NULL);
}
if ((tag = get_buddy_tag(conv, old_name, 0, FALSE)))
@@ -6357,10 +6359,10 @@ pidgin_conv_chat_update_user(PurpleConve
cbuddy = purple_conv_chat_cb_find(chat, user);
if (get_iter_from_chatbuddy(cbuddy, &iter)) {
- GtkTreeRowReference *ref = cbuddy->ui_data;
+ GtkTreeRowReference *ref = purple_conv_chat_cb_get_ui_data(cbuddy);
gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
gtk_tree_row_reference_free(ref);
- cbuddy->ui_data = NULL;
+ purple_conv_chat_cb_set_ui_data(cbuddy, NULL);
}
if (cbuddy)
============================================================
--- libpurple/protocols/sametime/sametime.c 37f43bafa391e0f6a43ea000f765f4677320bff2
+++ libpurple/protocols/sametime/sametime.c a320ead43e6868ce44fd1ba164d0522b3da4ae05
@@ -220,7 +220,7 @@ struct mwPurplePluginData {
gint outpa; /* like inpa, but the other way */
/** circular buffer for outgoing data */
- PurpleCircBuffer *sock_buf;
+ PurpleCircularBuffer *sock_buf;
PurpleConnection *gc;
};
@@ -342,7 +342,7 @@ static void write_cb(gpointer data, gint
static void write_cb(gpointer data, gint source, PurpleInputCondition cond) {
struct mwPurplePluginData *pd = data;
- PurpleCircBuffer *circ = pd->sock_buf;
+ PurpleCircularBuffer *circ = pd->sock_buf;
gsize avail;
int ret;
@@ -350,17 +350,17 @@ static void write_cb(gpointer data, gint
g_return_if_fail(circ != NULL);
- avail = purple_circ_buffer_get_max_read(circ);
+ avail = purple_circular_buffer_get_max_read(circ);
if(BUF_LONG < avail) avail = BUF_LONG;
while(avail) {
- ret = write(pd->socket, circ->outptr, avail);
+ ret = write(pd->socket, purple_circular_buffer_get_output(circ), avail);
if(ret <= 0)
break;
- purple_circ_buffer_mark_read(circ, ret);
- avail = purple_circ_buffer_get_max_read(circ);
+ purple_circular_buffer_mark_read(circ, ret);
+ avail = purple_circular_buffer_get_max_read(circ);
if(BUF_LONG < avail) avail = BUF_LONG;
}
@@ -385,7 +385,7 @@ static int mw_session_io_write(struct mw
if(pd->outpa) {
DEBUG_INFO("already pending INPUT_WRITE, buffering\n");
- purple_circ_buffer_append(pd->sock_buf, buf, len);
+ purple_circular_buffer_append(pd->sock_buf, buf, len);
return 0;
}
@@ -405,7 +405,7 @@ static int mw_session_io_write(struct mw
if(err == EAGAIN) {
/* append remainder to circular buffer */
DEBUG_INFO("EAGAIN\n");
- purple_circ_buffer_append(pd->sock_buf, buf, len);
+ purple_circular_buffer_append(pd->sock_buf, buf, len);
pd->outpa = purple_input_add(pd->socket, PURPLE_INPUT_WRITE, write_cb, pd);
} else if(len > 0) {
@@ -3170,7 +3170,7 @@ static struct mwPurplePluginData *mwPurp
pd->srvc_resolve = mw_srvc_resolve_new(pd->session);
pd->srvc_store = mw_srvc_store_new(pd->session);
pd->group_list_map = g_hash_table_new(g_direct_hash, g_direct_equal);
- pd->sock_buf = purple_circ_buffer_new(0);
+ pd->sock_buf = purple_circular_buffer_new(0);
mwSession_addService(pd->session, MW_SERVICE(pd->srvc_aware));
mwSession_addService(pd->session, MW_SERVICE(pd->srvc_conf));
@@ -3217,7 +3217,7 @@ static void mwPurplePluginData_free(stru
mwSession_free(pd->session);
g_hash_table_destroy(pd->group_list_map);
- purple_circ_buffer_destroy(pd->sock_buf);
+ g_object_unref(G_OBJECT(pd->sock_buf));
g_free(pd);
}
============================================================
--- libpurple/protocols/null/nullprpl.c b3cd718d53324e260f8ddb5b55bc21dcbe4143b0
+++ libpurple/protocols/null/nullprpl.c 8bac02004122ba26fcb33547eb56f40960d83cb0
@@ -53,6 +53,7 @@
#include "internal.h"
#include "account.h"
+#include "accountlist.h"
#include "accountopt.h"
#include "blist.h"
#include "cmds.h"
More information about the Commits
mailing list