From 368bb82818d4b68e4984698ea4454091ecb049a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 23 Jun 2017 15:05:07 +0200 Subject: Send an additional unsubscribed presence when receiving an unsubscribe one --- src/xmpp/biboumi_component.cpp | 1 + tests/end_to_end/__main__.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index 263b7bd..91e92aa 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -181,6 +181,7 @@ void BiboumiComponent::handle_presence(const Stanza& stanza) else if (type == "unsubscribe") { this->send_presence_to_contact(to_str, from.bare(), "unavailable", id); + this->send_presence_to_contact(to_str, from.bare(), "unsubscribed"); this->send_presence_to_contact(to_str, from.bare(), "unsubscribe"); #ifdef USE_DATABASE const bool res = Database::has_roster_item(to_str, from.bare()); diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py index a718a63..2957820 100644 --- a/tests/end_to_end/__main__.py +++ b/tests/end_to_end/__main__.py @@ -2692,8 +2692,10 @@ if __name__ == '__main__': # Unsubscribe partial(send_stanza, ""), partial(expect_stanza, "/presence[@type='unavailable']"), + partial(expect_stanza, "/presence[@type='unsubscribed']"), partial(expect_stanza, "/presence[@type='unsubscribe']"), partial(send_stanza, ""), + partial(send_stanza, ""), ]) ) -- cgit v1.2.3