Fix bug where ContactAdded event was not firing due to a bad if statement.

This commit is contained in:
Doggo 2023-05-15 12:33:43 +00:00 committed by Maxime “pep” Buquet
parent 88ab74c92f
commit 209c5b779a

View file

@ -299,7 +299,7 @@ impl Agent {
} else if let IqType::Result(Some(payload)) = iq.payload {
// TODO: move private iqs like this one somewhere else, for
// security reasons.
if payload.is("query", ns::ROSTER) && iq.from.is_none() {
if payload.is("query", ns::ROSTER) && Some(from.clone()) == iq.from {
let roster = Roster::try_from(payload).unwrap();
for item in roster.items.into_iter() {
events.push(Event::ContactAdded(item));