mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-18 04:19:55 +01:00
Work around Lucid gloox bug.
This commit is contained in:
parent
a39cccd059
commit
6cebb8e629
25
3rdparty/libxrme/connection.cpp
vendored
25
3rdparty/libxrme/connection.cpp
vendored
@ -108,7 +108,7 @@ struct Connection::Private : public gloox::ConnectionListener,
|
||||
void handleItemUnsubscribed(const gloox::JID&) {}
|
||||
void handleRoster(const gloox::Roster&) {}
|
||||
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 handleUnsubscriptionRequest(const gloox::JID&, const std::string&) { return false; }
|
||||
void handleNonrosterPresence(gloox::Stanza*) {}
|
||||
@ -358,14 +358,11 @@ Connection::Peer::Peer()
|
||||
: caps_(0) {
|
||||
}
|
||||
|
||||
void Connection::Private::handleRosterPresence(
|
||||
const gloox::RosterItem& item, const std::string& res,
|
||||
gloox::Presence presence, const std::string&) {
|
||||
// Ignore presence from anyone else
|
||||
if (item.jid() != client_->jid().bare()) {
|
||||
return;
|
||||
}
|
||||
|
||||
void Connection::Private::handleSelfPresence(
|
||||
const gloox::RosterItem& item,
|
||||
const std::string& res,
|
||||
gloox::Presence presence,
|
||||
const std::string&) {
|
||||
QString resource = QString::fromUtf8(res.c_str());
|
||||
|
||||
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 {
|
||||
foreach (const Peer& peer, peers_) {
|
||||
if (peer.jid_resource_ == jid_resource) {
|
||||
|
Loading…
Reference in New Issue
Block a user