eion/purple-hangouts

43d593e040d0
Parents 9f02a61d3df4
Children affe14b79674
Support display of self-sent-messages on Adium and Bitlbee
--- a/hangouts_events.c Sat Apr 01 22:32:36 2017 +1300
+++ b/hangouts_events.c Mon Apr 10 09:13:09 2017 +1200
@@ -659,7 +659,7 @@
msg = purple_xmlnode_to_str(html, NULL);
message_timestamp = time(NULL) - ((current_server_time - timestamp) / 1000000);
- msg_flags = (g_strcmp0(gaia_id, ha->self_gaia_id) ? PURPLE_MESSAGE_RECV : PURPLE_MESSAGE_SEND);
+ msg_flags = (g_strcmp0(gaia_id, ha->self_gaia_id) ? PURPLE_MESSAGE_RECV : (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_REMOTE_SEND | PURPLE_MESSAGE_DELAYED));
if (((current_server_time - timestamp) / 1000000) > 120) {
msg_flags |= PURPLE_MESSAGE_DELAYED;
}
--- a/purplecompat.h Sat Apr 01 22:32:36 2017 +1300
+++ b/purplecompat.h Mon Apr 10 09:13:09 2017 +1200
@@ -22,6 +22,9 @@
#define purple_chat_user_set_alias(cb, alias) g_object_set((cb), "alias", (alias), NULL)
#define purple_chat_get_alias(chat) g_object_get_data(G_OBJECT(chat), "alias")
+//TODO remove this when dx adds this to the PurpleMessageFlags enum
+#define PURPLE_MESSAGE_REMOTE_SEND 0x10000
+
#else /*!PURPLE_VERSION_CHECK(3, 0, 0)*/
#include "connection.h"
@@ -113,6 +116,9 @@
g_free(message->what);
g_free(message);
}
+#if !PURPLE_VERSION_CHECK(2, 12, 0)
+# define PURPLE_MESSAGE_REMOTE_SEND 0x10000
+#endif
#define PurpleProtocolChatEntry struct proto_chat_entry
#define PurpleChatUserFlags PurpleConvChatBuddyFlags