Пример #1
0
void Client::handleVCard(const gloox::JID& jid, const gloox::VCard* vcard)
{
  TRACE();

  if (vcard != NULL)
  {
    VCardToUser user(vcard);
    myHandler.onUserInfo(jid.bare(), user);

    if (jid.bare() == myClient.jid().bare())
      broadcastPhotoHash(user.pictureSha1());
  }
}
Пример #2
0
bool Client::handleSubscriptionRequest(
    const gloox::JID& jid, const string& msg)
{
  TRACE();

  myHandler.onUserAuthorizationRequest(jid.bare(), msg);
  return false; // Ignored by gloox
}
Пример #3
0
void Client::handleVCardResult(gloox::VCardHandler::VCardContext context,
                               const gloox::JID& jid, gloox::StanzaError error)
{
  TRACE();

  if (error != gloox::StanzaErrorUndefined)
  {
    gLog.warning("%s vCard for user %s failed with error %u",
        context == gloox::VCardHandler::StoreVCard ? "Storing" : "Fetching",
        jid ? jid.bare().c_str() : myClient.jid().bare().c_str(), error);
  }

  if (!jid && context == gloox::VCardHandler::StoreVCard)
  {
    if (error == gloox::StanzaErrorUndefined)
      broadcastPhotoHash(myPendingPhotoHash);
    else
      broadcastPhotoHash(boost::none);

    myPendingPhotoHash = boost::none;
  }
}
Пример #4
0
void Client::handleItemUnsubscribed(const gloox::JID& jid)
{
  TRACE("%s", jid.full().c_str());

  gLog.info("No longer authorized for %s", jid.bare().c_str());
}
Пример #5
0
void Client::handleItemRemoved(const gloox::JID& jid)
{
  TRACE("%s", jid.full().c_str());

  myHandler.onUserRemoved(jid.bare());
}