aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2018-03-19 00:22:22 -0300
committerdequis <dx@dxzone.com.ar>2018-03-19 00:22:22 -0300
commit7a99a0c8713d34febb69952a42930222a7fda67d (patch)
tree6557a213ab36e2ba6eb17cd37073357744ed2765
parent686ac516c799853b2267e5f9da7e7d96b2dcc788 (diff)
purple: support PURPLE_MESSAGE_REMOTE_SEND for groupchat self-messages
Requires libpurple 2.12.0 Mostly relevant recently with slack-libpurple.
-rw-r--r--protocols/purple/purple.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c
index 5d935028..8bf73331 100644
--- a/protocols/purple/purple.c
+++ b/protocols/purple/purple.c
@@ -30,6 +30,10 @@
#include <glib.h>
#include <purple.h>
+#if !PURPLE_VERSION_CHECK(2, 12, 0)
+#define PURPLE_MESSAGE_REMOTE_SEND 0x10000
+#endif
+
GSList *purple_connections;
/* This makes me VERY sad... :-( But some libpurple callbacks come in without
@@ -1203,7 +1207,10 @@ static void handle_conv_msg(PurpleConversation *conv, const char *who, const cha
* Those are safe to display. The rest (with just _SEND) may be echoes. */
static void prplcb_conv_msg(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime)
{
- if ((!(flags & PURPLE_MESSAGE_SEND)) || (flags & PURPLE_MESSAGE_DELAYED)) {
+ if ((!(flags & PURPLE_MESSAGE_SEND)) ||
+ (flags & PURPLE_MESSAGE_DELAYED) ||
+ (flags & PURPLE_MESSAGE_REMOTE_SEND)
+ ) {
handle_conv_msg(conv, who, message, (flags & PURPLE_MESSAGE_SEND) ? OPT_SELFMESSAGE : 0, mtime);
}
}