/pidgin/main: fb04c75906e0: Gadu-Gadu: update code for the new l...
Tomasz Wasilczyk
twasilczyk at pidgin.im
Tue Oct 8 12:01:19 EDT 2013
Changeset: fb04c75906e0bc3af8d584e1b0bed4115b215f8e
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2013-10-08 18:01 +0200
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/fb04c75906e0
Description:
Gadu-Gadu: update code for the new libpurple and libgadu APIs
diffstat:
libpurple/protocols/gg/chat.c | 6 +++---
libpurple/protocols/gg/gg.c | 16 +++++++++++++++-
libpurple/protocols/gg/tcpsocket.c | 8 ++++----
3 files changed, 22 insertions(+), 8 deletions(-)
diffs (91 lines):
diff --git a/libpurple/protocols/gg/chat.c b/libpurple/protocols/gg/chat.c
--- a/libpurple/protocols/gg/chat.c
+++ b/libpurple/protocols/gg/chat.c
@@ -368,7 +368,7 @@ void ggp_chat_join(PurpleConnection *gc,
char *buff = g_strdup_printf(
_("%s is not a valid room identifier"), id_cs);
purple_notify_error(gc, _("Invalid Room Identifier"),
- _("Invalid Room Identifier"), buff);
+ _("Invalid Room Identifier"), buff, NULL);
g_free(buff);
purple_serv_got_join_chat_failed(gc, components);
return;
@@ -403,7 +403,7 @@ static void ggp_chat_join_id(PurpleConne
_("%s is not a valid room identifier"), id_s);
g_free(id_s);
purple_notify_error(gc, _("Invalid Room Identifier"),
- _("Invalid Room Identifier"), buff);
+ _("Invalid Room Identifier"), buff, NULL);
g_free(buff);
}
else /* if (chat->left) */
@@ -411,7 +411,7 @@ static void ggp_chat_join_id(PurpleConne
purple_notify_error(gc, _("Could not join chat room"),
_("Could not join chat room"),
_("You have to ask for invitation from another chat "
- "participant"));
+ "participant"), NULL);
}
components = ggp_chat_info_defaults(gc, ggp_chat_get_name_from_id(id));
diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -321,6 +321,18 @@ static void ggp_callback_recv(gpointer _
return;
}
+#if GGP_ENABLE_GG11
+ if (purple_debug_is_verbose()) {
+ purple_debug_misc("gg", "ggp_callback_recv: got event %s",
+ gg_debug_event(ev->type));
+ }
+#endif
+
+ purple_input_remove(info->inpa);
+ info->inpa = purple_input_add(info->session->fd,
+ ggp_tcpsocket_inputcond_gg_to_purple(info->session->check),
+ ggp_callback_recv, gc);
+
switch (ev->type) {
case GG_EVENT_NONE:
/* Nothing happened. */
@@ -333,10 +345,11 @@ static void ggp_callback_recv(gpointer _
case GG_EVENT_MSG:
ggp_message_got(gc, &ev->event.msg);
break;
+ case GG_EVENT_ACK:
#if GGP_ENABLE_GG11
case GG_EVENT_ACK110:
+#endif
break;
-#endif
case GG_EVENT_IMAGE_REPLY:
ggp_image_recv(gc, &ev->event.image_reply);
break;
@@ -738,6 +751,7 @@ static void ggp_login(PurpleAccount *acc
glp->protocol_version = GG_PROTOCOL_VERSION_100;
else if (g_strcmp0(protocol_version, "gg11") == 0)
glp->protocol_version = GG_PROTOCOL_VERSION_110;
+ glp->compatibility = GG_COMPAT_1_12_0;
#else
glp->protocol_version = 0x2e;
#endif
diff --git a/libpurple/protocols/gg/tcpsocket.c b/libpurple/protocols/gg/tcpsocket.c
--- a/libpurple/protocols/gg/tcpsocket.c
+++ b/libpurple/protocols/gg/tcpsocket.c
@@ -86,10 +86,10 @@ ggp_tcpsocket_setup(PurpleConnection *gc
glp->socket_manager_type = purple_ssl_is_supported() ?
GG_SOCKET_MANAGER_TYPE_TLS : GG_SOCKET_MANAGER_TYPE_TCP;
glp->socket_manager.cb_data = gc;
- glp->socket_manager.connect = ggp_tcpsocket_connect;
- glp->socket_manager.close = ggp_tcpsocket_close;
- glp->socket_manager.read = ggp_tcpsocket_read;
- glp->socket_manager.write = ggp_tcpsocket_write;
+ glp->socket_manager.connect_cb = ggp_tcpsocket_connect;
+ glp->socket_manager.close_cb = ggp_tcpsocket_close;
+ glp->socket_manager.read_cb = ggp_tcpsocket_read;
+ glp->socket_manager.write_cb = ggp_tcpsocket_write;
}
#else
More information about the Commits
mailing list