Do not allow pings from resources that aren’t in the channel

fix #3252
This commit is contained in:
louiz’
2017-04-04 21:38:53 +02:00
parent e4cc69607c
commit 0878a0342c
2 changed files with 30 additions and 1 deletions
+2 -1
View File
@@ -744,9 +744,10 @@ void Bridge::send_irc_participant_ping_request(const Iid& iid, const std::string
const std::string& iq_id, const std::string& to_jid,
const std::string& from_jid)
{
Jid from(to_jid);
IrcClient* irc = this->get_irc_client(iid.get_server());
IrcChannel* chan = irc->get_channel(iid.get_local());
if (!chan->joined)
if (!chan->joined || !this->is_resource_in_chan(iid.to_tuple(), from.resource))
{
this->xmpp.send_stanza_error("iq", to_jid, from_jid, iq_id, "cancel", "not-allowed",
"", true);