本文整理汇总了C++中gloox::JID类的典型用法代码示例。如果您正苦于以下问题:C++ JID类的具体用法?C++ JID怎么用?C++ JID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JID类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: handleVCard
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());
}
}
开发者ID:j0wl,项目名称:licq,代码行数:13,代码来源:client.cpp
示例2: handleItemUpdated
void ClientConnection::handleItemUpdated (const gloox::JID& jid)
{
if (!JID2CLEntry_.contains (jid.bareJID ()))
{
qWarning () << Q_FUNC_INFO
<< "strange, we have no"
<< jid.full ().c_str ()
<< "in our JID2CLEntry_";
return;
}
emit rosterItemUpdated (JID2CLEntry_ [jid.bareJID ()]);
}
开发者ID:grio,项目名称:leechcraft,代码行数:13,代码来源:clientconnection.cpp
示例3: handleItemRemoved
void ClientConnection::handleItemRemoved (const gloox::JID& jid)
{
if (!JID2CLEntry_.contains (jid.bareJID ()))
{
qWarning () << Q_FUNC_INFO
<< "strange, we have no"
<< jid.full ().c_str ()
<< "in our JID2CLEntry_";
return;
}
GlooxCLEntry *entry = JID2CLEntry_.take (jid.bareJID ());
emit rosterItemRemoved (entry);
}
开发者ID:grio,项目名称:leechcraft,代码行数:14,代码来源:clientconnection.cpp
示例4: handleItemUpdated
void Client::handleItemUpdated(const gloox::JID& jid)
{
TRACE("%s", jid.full().c_str());
gloox::RosterItem* item = myRosterManager->getRosterItem(jid);
addRosterItem(*item);
}
开发者ID:j0wl,项目名称:licq,代码行数:7,代码来源:client.cpp
示例5: handleItemAdded
void ClientConnection::handleItemAdded (const gloox::JID& jid)
{
gloox::RosterItem *ri = Client_->rosterManager ()->getRosterItem (jid);
GlooxCLEntry *entry = new GlooxCLEntry (ri, Account_);
JID2CLEntry_ [jid.bareJID ()] = entry;
emit gotRosterItems (QList<QObject*> () << entry);
}
开发者ID:grio,项目名称:leechcraft,代码行数:8,代码来源:clientconnection.cpp
示例6: handleSubscriptionRequest
bool Client::handleSubscriptionRequest(
const gloox::JID& jid, const string& msg)
{
TRACE();
myHandler.onUserAuthorizationRequest(jid.bare(), msg);
return false; // Ignored by gloox
}
开发者ID:j0wl,项目名称:licq,代码行数:8,代码来源:client.cpp
示例7: LowLength
void Modul::LowLength( gloox::MUCRoom *muc
, const gloox::JID &from
, const bool priv ) const {
std::string msg = "неправильно заданы параметры";
if( priv )
Send( from, msg, "" );
else
muc->send( from.resource() + ": " + msg );
}
开发者ID:ShitalBorganve,项目名称:ozbot,代码行数:9,代码来源:modul.cpp
示例8: NotPermissed
void RootModul::NotPermissed( const gloox::JID &user, gloox::MUCRoom *room, const bool priv ){
const int MESSAGES_NUMBER = 4;
const std::string messages[] = { "Вы не в праве повелевать мной :P"
, "Сударь, что Вы себе позволяете?"
, "укуси мой зад :P"
, "лизни тунца :P" };
const std::string msg = messages[ std::rand() % MESSAGES_NUMBER ];
if( priv )
Send( user, msg, "" );
else
room->send( user.resource() + ": " + msg );
}
开发者ID:ShitalBorganve,项目名称:ozbot,代码行数:12,代码来源:modul.cpp
示例9: Send
void Modul::Send( gloox::MUCRoom *room
, const gloox::JID &to
, const std::string &msg
, bool priv ) const {
const std::string::size_type MAX_MUC_MSG_LENGTH = 150;
if( priv )
Send( to, msg );
else
if( msg.length( ) > MAX_MUC_MSG_LENGTH ){
Send( room, to, "Сообщение отправлено в личку", priv );
Send( to, msg );
}else
room->send( to.resource() + ": " + msg );
}
开发者ID:ShitalBorganve,项目名称:ozbot,代码行数:14,代码来源:modul.cpp
示例10: handleVCardResult
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;
}
}
开发者ID:j0wl,项目名称:licq,代码行数:22,代码来源:client.cpp
示例11: onVCard
bool UserPlugin::onVCard(const VCardWrapper& vcardWrapper)
{
const gloox::JID jid=vcardWrapper.jid();
gloox::VCard vcard=gloox::VCard(vcardWrapper.vcard());
qDebug() << "Got vcard: "+vcardWrapper.id();
QString jidStr=QString::fromStdString(jid.full());
QString reqId=QString("vcard_%1").arg(vcardWrapper.id());
AsyncRequest* req=bot()->asyncRequests()->byStanzaId(reqId);
if (req==0l)
{
return false;
}
if (vcardWrapper.isEmpty())
{
reply(req->stanza(), "No VCard found");
bot()->asyncRequests()->removeAll(req);
return true;
}
if (req->name()=="VCARD")
{
QString replyStr=vcardWrapper.vcardStr();
if (replyStr.isEmpty())
{
reply(req->stanza(), "Empty VCard");
}
else
{
reply(req->stanza(), QString("VCard: %1").arg(replyStr));
}
}
else if (req->name()=="PHOTO")
{
std::string photoContentStd=vcard.photo().binval;
QByteArray photoContent=QByteArray(photoContentStd.data(),
photoContentStd.size());
//QFile file("/tmp/out.png");
//file.open(QIODevice::WriteOnly);
//file.write(photoContentStd.data(), photoContentStd.size());
//file.close();
QImage image;
if (!image.loadFromData(photoContent))
{
reply(req->stanza(), "Can't load image");
bot()->asyncRequests()->removeAll(req);
return true;
}
MessageParser parser(req->stanza(), getMyNick(req->stanza()));
parser.nextToken();
QString cmd=parser.nextToken().toUpper();
QString jid=parser.nextToken();
QString widthStr=parser.nextToken();
QString white=parser.nextToken();
QString black=parser.nextToken();
Image2Ascii img2ascii(image);
if (!widthStr.isEmpty())
img2ascii.setWidth(widthStr.toInt());
if (!white.isEmpty() && white.length()<=5)
img2ascii.setWhite(white);
if (!black.isEmpty() && black.length()<=5)
img2ascii.setBlack(black);
QString ascii=img2ascii.ascii();
if (ascii.isEmpty())
reply(req->stanza(), "Can't convert image to ASCII");
else
reply(req->stanza(), QString("Photo:\n%1").arg(ascii));
}
bot()->asyncRequests()->removeAll(req);
return true;
}
开发者ID:shizeeg,项目名称:gluxi,代码行数:75,代码来源:userplugin.cpp
示例12: handleItemUnsubscribed
void Client::handleItemUnsubscribed(const gloox::JID& jid)
{
TRACE("%s", jid.full().c_str());
gLog.info("No longer authorized for %s", jid.bare().c_str());
}
开发者ID:j0wl,项目名称:licq,代码行数:6,代码来源:client.cpp
示例13: handleItemRemoved
void Client::handleItemRemoved(const gloox::JID& jid)
{
TRACE("%s", jid.full().c_str());
myHandler.onUserRemoved(jid.bare());
}
开发者ID:j0wl,项目名称:licq,代码行数:6,代码来源:client.cpp
注:本文中的gloox::JID类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论