1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

Don't print subscribed message if contact is already in roster

This occured with a user running Cisco Jabber. It seems this server
sends repeated presence subscribed stanzas. And although I find this
strange according to RFC this seems to be ok.

So let's filter them and only display in the console output and to the
log. But don't open seperate windows.

Fix https://github.com/profanity-im/profanity/issues/1165
This commit is contained in:
Michael Vetter 2019-08-01 20:48:23 +02:00
parent d4150eb7d1
commit 53c3115976

View File

@ -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);
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);