about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-08-02 12:48:01 +0200
committerGitHub <noreply@github.com>2019-08-02 12:48:01 +0200
commit5d711639b060eb0454fee69c5f8e5ffcc27f492f (patch)
tree8fc0a577228bb21b8521e4bdb93564a3bf3f32d5 /src
parent658e36a06618dd48798133983c4a234e747834ad (diff)
parent53c31159769296a9797da6653bc070b9467f3c08 (diff)
downloadprofani-tty-5d711639b060eb0454fee69c5f8e5ffcc27f492f.tar.gz
Merge pull request #1166 from profanity-im/fix/1165-subscribed-msg
Don't print subscribed message if contact is already in roster
Diffstat (limited to 'src')
-rw-r--r--src/event/server_events.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c
index 86a9ae8d..14c0a11a 100644
--- a/src/event/server_events.c
+++ b/src/event/server_events.c
@@ -863,9 +863,13 @@ sv_ev_subscription(const char *barejid, jabber_subscr_t type)
         }
         break;
     case PRESENCE_SUBSCRIBED:
-        cons_show("Subscription received from %s", barejid);
         log_info("Subscription received from %s", barejid);
-        ui_print_system_msg_from_recipient(barejid, "Subscribed");
+        cons_show("Subscription received from %s", barejid);
+
+        PContact contact = roster_get_contact(barejid);
+        if (contact == NULL) {
+            ui_print_system_msg_from_recipient(barejid, "Subscribed");
+        }
         break;
     case PRESENCE_UNSUBSCRIBED:
         cons_show("%s deleted subscription", barejid);