Commit 368bb828 authored by louiz’'s avatar louiz’

Send an additional unsubscribed presence when receiving an unsubscribe one

parent 7e5cd2f1
...@@ -181,6 +181,7 @@ void BiboumiComponent::handle_presence(const Stanza& stanza) ...@@ -181,6 +181,7 @@ void BiboumiComponent::handle_presence(const Stanza& stanza)
else if (type == "unsubscribe") else if (type == "unsubscribe")
{ {
this->send_presence_to_contact(to_str, from.bare(), "unavailable", id); 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"); this->send_presence_to_contact(to_str, from.bare(), "unsubscribe");
#ifdef USE_DATABASE #ifdef USE_DATABASE
const bool res = Database::has_roster_item(to_str, from.bare()); const bool res = Database::has_roster_item(to_str, from.bare());
......
...@@ -2692,8 +2692,10 @@ if __name__ == '__main__': ...@@ -2692,8 +2692,10 @@ if __name__ == '__main__':
# Unsubscribe # Unsubscribe
partial(send_stanza, "<presence from='{jid_one}' to='{biboumi_host}' type='unsubscribe' id='unsubid1' />"), partial(send_stanza, "<presence from='{jid_one}' to='{biboumi_host}' type='unsubscribe' id='unsubid1' />"),
partial(expect_stanza, "/presence[@type='unavailable']"), partial(expect_stanza, "/presence[@type='unavailable']"),
partial(expect_stanza, "/presence[@type='unsubscribed']"),
partial(expect_stanza, "/presence[@type='unsubscribe']"), partial(expect_stanza, "/presence[@type='unsubscribe']"),
partial(send_stanza, "<presence from='{jid_one}' to='{biboumi_host}' type='unavailable' />"), partial(send_stanza, "<presence from='{jid_one}' to='{biboumi_host}' type='unavailable' />"),
partial(send_stanza, "<presence from='{jid_one}' to='{biboumi_host}' type='unsubscribed' />"),
]) ])
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment