Commit dd343609 authored by louiz’'s avatar louiz’

Only send the IRC server presence if the user has this JID in their roster

parent f9a6f973
......@@ -1025,12 +1025,20 @@ void BiboumiComponent::send_presence_to_contact(const std::string& from, const s
void BiboumiComponent::on_irc_client_connected(const std::string& irc_hostname, const std::string& jid)
{
this->send_presence_to_contact(irc_hostname + "@" + this->served_hostname, jid, "");
#ifdef USE_DATABASE
const auto local_jid = irc_hostname + "@" + this->served_hostname;
if (Database::has_roster_item(local_jid, jid))
this->send_presence_to_contact(local_jid, jid, "");
#endif
}
void BiboumiComponent::on_irc_client_disconnected(const std::string& irc_hostname, const std::string& jid)
{
#ifdef USE_DATABASE
const auto local_jid = irc_hostname + "@" + this->served_hostname;
if (Database::has_roster_item(local_jid, jid))
this->send_presence_to_contact(irc_hostname + "@" + this->served_hostname, jid, "unavailable");
#endif
}
void BiboumiComponent::after_handshake()
......
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