1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-18 12:28:31 +01:00

Work around Lucid gloox bug.

This commit is contained in:
John Maguire 2011-02-22 15:08:35 +00:00
parent a39cccd059
commit 6cebb8e629

View File

@ -108,7 +108,7 @@ struct Connection::Private : public gloox::ConnectionListener,
void handleItemUnsubscribed(const gloox::JID&) {} void handleItemUnsubscribed(const gloox::JID&) {}
void handleRoster(const gloox::Roster&) {} void handleRoster(const gloox::Roster&) {}
void handleRosterPresence(const gloox::RosterItem& item, const std::string& resource, gloox::Presence presence, const std::string& msg); void handleRosterPresence(const gloox::RosterItem& item, const std::string& resource, gloox::Presence presence, const std::string& msg);
void handleSelfPresence(const gloox::RosterItem&, const std::string&, gloox::Presence, const std::string&) {} void handleSelfPresence(const gloox::RosterItem&, const std::string&, gloox::Presence, const std::string&);
bool handleSubscriptionRequest(const gloox::JID&, const std::string&) { return false; } bool handleSubscriptionRequest(const gloox::JID&, const std::string&) { return false; }
bool handleUnsubscriptionRequest(const gloox::JID&, const std::string&) { return false; } bool handleUnsubscriptionRequest(const gloox::JID&, const std::string&) { return false; }
void handleNonrosterPresence(gloox::Stanza*) {} void handleNonrosterPresence(gloox::Stanza*) {}
@ -358,14 +358,11 @@ Connection::Peer::Peer()
: caps_(0) { : caps_(0) {
} }
void Connection::Private::handleRosterPresence( void Connection::Private::handleSelfPresence(
const gloox::RosterItem& item, const std::string& res, const gloox::RosterItem& item,
gloox::Presence presence, const std::string&) { const std::string& res,
// Ignore presence from anyone else gloox::Presence presence,
if (item.jid() != client_->jid().bare()) { const std::string&) {
return;
}
QString resource = QString::fromUtf8(res.c_str()); QString resource = QString::fromUtf8(res.c_str());
switch (presence) { switch (presence) {
@ -407,6 +404,16 @@ void Connection::Private::handleRosterPresence(
} }
} }
void Connection::Private::handleRosterPresence(
const gloox::RosterItem& item, const std::string& res,
gloox::Presence presence, const std::string& message) {
// Forward incorrect calls of this with our JID.
if (item.jid() == client_->jid().bare()) {
handleSelfPresence(item, res, presence, message);
}
// Ignore presence from anyone else
}
bool Connection::Private::has_peer(const QString& jid_resource) const { bool Connection::Private::has_peer(const QString& jid_resource) const {
foreach (const Peer& peer, peers_) { foreach (const Peer& peer, peers_) {
if (peer.jid_resource_ == jid_resource) { if (peer.jid_resource_ == jid_resource) {