about summary refs log tree commit diff stats
path: root/src/xmpp/xmpp.h
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-06-30 23:42:32 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-07-01 00:14:32 +0200
commit31ebd6ab1cb464c66b1555e5d78896a46d092cc9 (patch)
tree674b49364a0e962c2b836f0fc36c5e38500f4511 /src/xmpp/xmpp.h
parentdc79c514be403cff93a1165b47d456182a03fd05 (diff)
downloadprofani-tty-31ebd6ab1cb464c66b1555e5d78896a46d092cc9.tar.gz
Add XEP-0377: Spam Reporting
Report and block:
`/blocked add someone@domain.org report-abuse This is not nice`
`/blocked add someone@domain.org report-spam This is not nice`

Regular block:
`/blocked add someone@domain.org`

Implement https://github.com/profanity-im/profanity/issues/1434
Diffstat (limited to 'src/xmpp/xmpp.h')
-rw-r--r--src/xmpp/xmpp.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h
index 003c3e07..61c7a642 100644
--- a/src/xmpp/xmpp.h
+++ b/src/xmpp/xmpp.h
@@ -70,6 +70,7 @@
 #define XMPP_FEATURE_USER_AVATAR_METADATA_NOTIFY "urn:xmpp:avatar:metadata+notify"
 #define XMPP_FEATURE_LAST_MESSAGE_CORRECTION     "urn:xmpp:message-correct:0"
 #define XMPP_FEATURE_MAM2                        "urn:xmpp:mam:2"
+#define XMPP_FEATURE_SPAM_REPORTING              "urn:xmpp:reporting:1"
 
 typedef enum {
     JABBER_CONNECTING,
@@ -89,6 +90,12 @@ typedef enum {
     INVITE_MEDIATED
 } jabber_invite_t;
 
+typedef enum {
+    BLOCKED_NO_REPORT,
+    BLOCKED_REPORT_ABUSE,
+    BLOCKED_REPORT_SPAM
+} blocked_report;
+
 typedef struct bookmark_t
 {
     char* barejid;
@@ -286,7 +293,7 @@ void roster_send_add_new(const char* const barejid, const char* const name);
 void roster_send_remove(const char* const barejid);
 
 GList* blocked_list(void);
-gboolean blocked_add(char* jid);
+gboolean blocked_add(char* jid, blocked_report reportkind, const char* const message);
 gboolean blocked_remove(char* jid);
 char* blocked_ac_find(const char* const search_str, gboolean previous, void* context);
 void blocked_ac_reset(void);