From 7a99a0c8713d34febb69952a42930222a7fda67d Mon Sep 17 00:00:00 2001 From: dequis Date: Mon, 19 Mar 2018 00:22:22 -0300 Subject: purple: support PURPLE_MESSAGE_REMOTE_SEND for groupchat self-messages Requires libpurple 2.12.0 Mostly relevant recently with slack-libpurple. --- protocols/purple/purple.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 #include +#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); } } -- cgit v1.2.3