From 694680d69e336f2465d238f499afd37ba7ab65f7 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 31 May 2024 11:20:06 +0200 Subject: [PATCH] Remove subscription when reporting spam/abuse When users receive a message and a subscription request from a new contact, and they use `/blocked report-abse JID` or `/blocked report-spam JID` they most likely want the subscription request to vanish as well. According to mdosch Conversations is behaving like this too. Fix: https://github.com/profanity-im/profanity/issues/1970 --- src/command/cmd_funcs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index bb274c7e..732c7dc8 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -3077,6 +3077,12 @@ cmd_blocked(ProfWin* window, const char* const command, gchar** args) if (!res) { cons_show("User %s already blocked.", args[1]); } + + // remove the subscription as well + if (presence_sub_request_exists(jid)) { + presence_subscription(jid, PRESENCE_UNSUBSCRIBED); + } + return TRUE; }