From 8c708bb0b6e381984c14e66bb21d9f8731b3981e Mon Sep 17 00:00:00 2001 From: jgeboski Date: Sat, 15 Aug 2015 21:36:14 -0400 Subject: [PATCH] VERSION: updated to dd1528f03f59 --- ChangeLog | 9 +++++ VERSION | 2 +- include/purple-compat.h | 19 ++++++++-- patches/02-plugin.patch | 84 ++++++++++++++++++++++++++++++----------- 4 files changed, 88 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 772e16a1..92bd1113 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +purple-facebook-dd1528f03f59 (2015-08-15): + - Added GTK-Doc for the internal APIs + - Fixed HTTP error checks being skipped + - Fixed timestamps not being set for self messages + - Inform the user of invalid group chat names + - Minor code refactoring + - Only mark conversations as read if they been focused + - Periodically refetch the contact list for updates + purple-facebook-3d30d24fdbef (2015-08-11): - Add and alias non-friend buddies - Added support for all XMA messages diff --git a/VERSION b/VERSION index 5771a477..dcb7550d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3d30d24fdbef +dd1528f03f59 diff --git a/include/purple-compat.h b/include/purple-compat.h index 05ce1c19..fd39642d 100644 --- a/include/purple-compat.h +++ b/include/purple-compat.h @@ -32,20 +32,23 @@ struct _PurpleMessage const gchar *name; const gchar *text; PurpleMessageFlags flags; + guint64 timestamp; }; #undef purple_notify_error #define PurpleChatConversation PurpleConvChat -#define PurpleProtocolChatEntry struct proto_chat_entry +#define PurpleConversationUpdateType PurpleConvUpdateType #define PurpleIMConversation PurpleConvIm #define PurpleIMTypingState PurpleTypingState #define PurpleProtocol void +#define PurpleProtocolChatEntry struct proto_chat_entry #define PurpleRequestCommonParameters void #define PURPLE_CMD_FLAG_PROTOCOL_ONLY PURPLE_CMD_FLAG_PRPL_ONLY #define PURPLE_CMD_P_PROTOCOL PURPLE_CMD_P_PRPL #define PURPLE_CONNECTION_CONNECTED PURPLE_CONNECTED +#define PURPLE_CONVERSATION_UPDATE_UNSEEN PURPLE_CONV_UPDATE_UNSEEN #define PURPLE_IM_NOT_TYPING PURPLE_NOT_TYPING #define PURPLE_IM_TYPING PURPLE_TYPING @@ -102,7 +105,8 @@ struct _PurpleMessage ) #define purple_conversation_write_message(c, m) \ - purple_conversation_write(c, (m)->name, (m)->text, (m)->flags, 0); + purple_conversation_write(c, (m)->name, (m)->text, (m)->flags, \ + (m)->timestamp); #define purple_im_conversation_new(a, n) \ purple_conversation_get_im_data( \ @@ -112,11 +116,18 @@ struct _PurpleMessage #define purple_message_new_outgoing(n, t, f) \ ((PurpleMessage *) &((PurpleMessage) {n, t, f})) +#define purple_message_set_time(m, t) \ + G_STMT_START { \ + (m)->timestamp = t; \ + } G_STMT_END + #define purple_notify_error(h, t, p, s, c) \ - purple_notify_message(h, PURPLE_NOTIFY_MSG_ERROR, t, p, s, NULL, NULL) + purple_notify_message(h, PURPLE_NOTIFY_MSG_ERROR, t, p, s, NULL, NULL); \ + (void)(c); #define purple_request_fields(h, t, p, s, f, ot, oc, ct, cc, c, d) \ - purple_request_fields(h, t, p, s, f, ot, oc, ct, cc, NULL, NULL, NULL, d) + purple_request_fields(h, t, p, s, f, ot, oc, ct, cc, NULL, NULL, NULL, d); \ + (void)(c); #define purple_serv_got_joined_chat(c, i, n) \ purple_conversation_get_chat_data( \ diff --git a/patches/02-plugin.patch b/patches/02-plugin.patch index e1b8b821..029213ea 100644 --- a/patches/02-plugin.patch +++ b/patches/02-plugin.patch @@ -1,7 +1,7 @@ -diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c ---- a/libpurple/protocols/facebook/facebook.c Tue Aug 11 19:33:09 2015 -0400 -+++ b/libpurple/protocols/facebook/facebook.c Tue Aug 11 19:56:11 2015 -0400 -@@ -615,7 +615,7 @@ +diff -r dd1528f03f59 libpurple/protocols/facebook/facebook.c +--- a/libpurple/protocols/facebook/facebook.c Sat Aug 15 21:21:10 2015 -0400 ++++ b/libpurple/protocols/facebook/facebook.c Sat Aug 15 21:31:10 2015 -0400 +@@ -761,7 +761,7 @@ GSList *select = NULL; PurpleConnection *gc; @@ -10,7 +10,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c return; } -@@ -794,7 +794,7 @@ +@@ -955,7 +955,7 @@ PurpleConnection *gc; PurpleMenuAction *act; @@ -19,7 +19,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c return NULL; } -@@ -842,7 +842,8 @@ +@@ -1003,7 +1003,8 @@ } static gint @@ -29,7 +29,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c { const gchar *name; const gchar *text; -@@ -851,6 +852,8 @@ +@@ -1012,6 +1013,8 @@ FbId uid; gchar *sext; @@ -38,7 +38,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c fata = purple_connection_get_protocol_data(gc); api = fb_data_get_api(fata); -@@ -978,7 +981,8 @@ +@@ -1150,7 +1153,8 @@ } static gint @@ -48,7 +48,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c { const gchar *name; const gchar *text; -@@ -989,6 +993,8 @@ +@@ -1161,6 +1165,8 @@ PurpleAccount *acct; PurpleChatConversation *chat; @@ -57,7 +57,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c acct = purple_connection_get_account(gc); fata = purple_connection_get_protocol_data(gc); api = fb_data_get_api(fata); -@@ -1162,103 +1168,6 @@ +@@ -1334,107 +1340,6 @@ } static void @@ -66,10 +66,14 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c - GList *opts = NULL; - PurpleAccountOption *opt; - -- protocol->id = "prpl-facebook"; +- protocol->id = FB_PROTOCOL_ID; - protocol->name = "Facebook"; - protocol->options = OPT_PROTO_CHAT_TOPIC; - +- opt = purple_account_option_int_new(_("Buddy list sync interval"), +- "sync-interval", 30); +- opts = g_list_prepend(opts, opt); +- - opt = purple_account_option_bool_new(_("Mark messages as read"), - "mark-read", TRUE); - opts = g_list_prepend(opts, opt); @@ -161,7 +165,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c fb_cmds_register(void) { PurpleCmdId id; -@@ -1270,13 +1179,13 @@ +@@ -1446,13 +1351,13 @@ g_return_if_fail(fb_cmds == NULL); id = purple_cmd_register("kick", "s", PURPLE_CMD_P_PROTOCOL, cflags, @@ -177,7 +181,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c _("leave: Leave the chat"), NULL); fb_cmds = g_slist_prepend(fb_cmds, GUINT_TO_POINTER(id)); -@@ -1295,43 +1204,97 @@ +@@ -1471,43 +1376,102 @@ g_slist_free_full(fb_cmds, fb_cmds_unregister_free); } @@ -187,7 +191,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c +plugin_load(PurplePlugin *plugin) { - return purple_plugin_info_new( -- "id", "prpl-facebook", +- "id", FB_PROTOCOL_ID, - "name", "Facebook Protocol", - "version", DISPLAY_VERSION, - "category", N_("Protocol"), @@ -242,6 +246,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c + static PurplePluginInfo info; + static PurplePluginProtocolInfo pinfo; + ++ (void) fb_protocol; + plugin->info = &info; + + if (G_LIKELY(inited)) { @@ -256,7 +261,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c + info.minor_version = PURPLE_MINOR_VERSION; + info.type = PURPLE_PLUGIN_PROTOCOL; + info.priority = PURPLE_PRIORITY_DEFAULT; -+ info.id = "prpl-facebook"; ++ info.id = FB_PROTOCOL_ID; + info.name = "Facebook"; + info.version = PACKAGE_VERSION; + info.summary = N_("Facebook Protocol Plugin"); @@ -288,6 +293,10 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c + pinfo.offline_message = fb_client_offline_message; + pinfo.struct_size = sizeof pinfo; + ++ opt = purple_account_option_int_new(_("Buddy list sync interval"), ++ "sync-interval", 30); ++ opts = g_list_prepend(opts, opt); ++ + opt = purple_account_option_bool_new(_("Mark messages as read"), + "mark-read", TRUE); + opts = g_list_prepend(opts, opt); @@ -305,11 +314,22 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c + inited = TRUE; + return purple_plugin_register(plugin); +} -diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.h ---- a/libpurple/protocols/facebook/facebook.h Tue Aug 11 19:33:09 2015 -0400 -+++ b/libpurple/protocols/facebook/facebook.h Tue Aug 11 19:56:11 2015 -0400 -@@ -24,29 +24,4 @@ +diff -r dd1528f03f59 libpurple/protocols/facebook/facebook.h +--- a/libpurple/protocols/facebook/facebook.h Sat Aug 15 21:21:10 2015 -0400 ++++ b/libpurple/protocols/facebook/facebook.h Sat Aug 15 21:31:10 2015 -0400 +@@ -22,24 +22,8 @@ + #ifndef _FACEBOOK_H_ + #define _FACEBOOK_H_ +-/** +- * SECTION:facebook +- * @section_id: facebook-plugin +- * @short_description: facebook.h +- * @title: Facebook Plugin +- * +- * The Facebook Messenger #PurpleProtocol. +- */ +- #include -#define FACEBOOK_TYPE_PROTOCOL (facebook_protocol_get_type()) @@ -319,22 +339,44 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.h -#define FACEBOOK_IS_PROTOCOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FACEBOOK_TYPE_PROTOCOL)) -#define FACEBOOK_PROTOCOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), FACEBOOK_TYPE_PROTOCOL, FacebookProtocolClass)) - + /** + * FB_PROTOCOL_ID: + * +@@ -47,37 +31,4 @@ + */ + #define FB_PROTOCOL_ID "prpl-facebook" + -typedef struct _FacebookProtocol FacebookProtocol; -typedef struct _FacebookProtocolClass FacebookProtocolClass; - +-/** +- * FacebookProtocol: +- * +- * Represents the Facebook #PurpleProtocol. +- */ -struct _FacebookProtocol -{ +- /*< private >*/ - PurpleProtocol parent; -}; - +-/** +- * FacebookProtocolClass: +- * +- * The base class for all #FacebookProtocol's. +- */ -struct _FacebookProtocolClass -{ +- /*< private >*/ - PurpleProtocolClass parent_class; -}; - -/** -- * Returns the GType for the FacebookProtocol object. +- * facebook_protocol_get_type: +- * +- * Returns: The #GType for a #FacebookProtocol. - */ --G_MODULE_EXPORT GType facebook_protocol_get_type(void); +-G_MODULE_EXPORT GType +-facebook_protocol_get_type(void); - #endif /* _FACEBOOK_H_ */