Skip to content

Commit

Permalink
VERSION: updated to dd1528f03f59
Browse files Browse the repository at this point in the history
  • Loading branch information
jgeboski committed Aug 16, 2015
1 parent 635a32f commit 8c708bb
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 26 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3d30d24fdbef
dd1528f03f59
19 changes: 15 additions & 4 deletions include/purple-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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( \
Expand All @@ -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( \
Expand Down
84 changes: 63 additions & 21 deletions patches/02-plugin.patch
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;

Expand All @@ -19,7 +19,7 @@ diff -r 3d30d24fdbef libpurple/protocols/facebook/facebook.c
return NULL;
}

@@ -842,7 +842,8 @@
@@ -1003,7 +1003,8 @@
}

static gint
Expand All @@ -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;

Expand All @@ -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
Expand All @@ -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;

Expand All @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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);
}

Expand All @@ -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"),
Expand Down Expand Up @@ -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)) {
Expand All @@ -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");
Expand Down Expand Up @@ -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);
Expand All @@ -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: <filename>facebook.h</filename>
- * @title: Facebook Plugin
- *
- * The Facebook Messenger #PurpleProtocol.
- */
-
#include <glib.h>

-#define FACEBOOK_TYPE_PROTOCOL (facebook_protocol_get_type())
Expand All @@ -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_ */

0 comments on commit 8c708bb

Please sign in to comment.