当前位置: 首页>>代码示例>>C++>>正文


C++ JID类代码示例

本文整理汇总了C++中JID的典型用法代码示例。如果您正苦于以下问题:C++ JID类的具体用法?C++ JID怎么用?C++ JID使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getLastPresence

Presence::ref PresenceOracle::getLastPresence(const JID& jid) const {
    PresencesMap::const_iterator i = entries_.find(jid.toBare());
    if (i == entries_.end()) {
        return Presence::ref();
    }
    PresenceMap presenceMap = i->second;
    PresenceMap::const_iterator j = presenceMap.find(jid);
    if (j != presenceMap.end()) {
        return j->second;
    }
    else {
        return Presence::ref();
    }
}
开发者ID:swift,项目名称:swift,代码行数:14,代码来源:PresenceOracle.cpp

示例2: handleSubscriptionRequest

 virtual bool handleSubscriptionRequest( const JID& jid, const std::string& /*msg*/ ) //发生收到好友请求(添加联系人-1)
 {
     //ack {false, true} {拒绝联系人请求,同意联系人请求}
     bool ack = true;
                 
     printf( "subscription: %s\n", jid.bare().c_str() );
     StringList groups;
     groups.push_back("Group-1");
     JID id( jid );
     //添加到了本地花名册
     j->rosterManager()->subscribe( id, "", groups, "" );
     
     return ack;
 }
开发者ID:liuzhuan23,项目名称:testcode-byWinTrust,代码行数:14,代码来源:gxcontacts.cpp

示例3: handleVCardReceived

void MainController::handleVCardReceived(const JID& jid, VCard::ref vCard) {
	if (!jid.equals(jid_, JID::WithoutResource) || !vCard) {
		return;
	}
	std::string hash;
	if (!vCard->getPhoto().empty()) {
		hash = Hexify::hexify(networkFactories_->getCryptoProvider()->getSHA1Hash(vCard->getPhoto()));
	}
	if (hash != vCardPhotoHash_) {
		vCardPhotoHash_ = hash;
		if (client_ && client_->isAvailable()) {
			sendPresence(statusTracker_->getNextPresence());
		}
	}
}
开发者ID:scopeInfinity,项目名称:swift,代码行数:15,代码来源:MainController.cpp

示例4: remove

  void RosterManager::remove( const JID& jid )
  {
    const std::string& id = m_parent->getID();

    Tag *iq = new Tag( "iq" );
    iq->addAttribute( "type", "set" );
    iq->addAttribute( "id", id );
    Tag *q = new Tag( iq, "query" );
    q->addAttribute( "xmlns", XMLNS_ROSTER );
    Tag *i = new Tag( q, "item" );
    i->addAttribute( "jid", jid.bare() );
    i->addAttribute( "subscription", "remove" );

    m_parent->send( iq );
  }
开发者ID:soubok,项目名称:libset,代码行数:15,代码来源:rostermanager.cpp

示例5: rejectInBandBytestream

 void InBandBytestreamManager::rejectInBandBytestream( InBandBytestream *ibb,
     const JID& from, const std::string& id )
 {
   delete ibb;
   Tag *iq = new Tag( "iq" );
   iq->addAttribute( "type", "error" );
   iq->addAttribute( "to", from.full() );
   iq->addAttribute( "id", id );
   Tag *e = new Tag( iq, "error" );
   e->addAttribute( "code", "501" );
   e->addAttribute( "type", "cancel" );
   Tag *f = new Tag( e, "feature-not-implemented" );
   f->addAttribute( "xmlns", XMLNS_XMPP_STANZAS );
   m_parent->send( iq );
 }
开发者ID:SupportSpace,项目名称:SupportCenter,代码行数:15,代码来源:inbandbytestreammanager.cpp

示例6: field

void JAccountRegistrationPage::onSuccess()
{
	ui->errorLabel->setText(QString());
	m_registered = true;
	if (m_jabberForm) {
		DataForm::Ptr form = m_jabberForm->getDataForm();
		DataFormField jidField = form->field(QLatin1String("username"));
		QString server = field(QLatin1String("server")).toString();
		JID jid = jidField.value() + QLatin1Char('@') + server;
		setField(QLatin1String("jid"), jid.bare());
		setField(QLatin1String("password"), QString());
		setField(QLatin1String("savePassword"), false);
	} else {
		DataItem item = m_form->item();
		DataItem jidItem = item.subitem(QString::number(Jreen::RegistrationData::UsernameField));
		QString server = field(QLatin1String("server")).toString();
		JID jid = jidItem.data().toString() + QLatin1Char('@') + server;
		setField(QLatin1String("jid"), jid.bare());
		setField(QLatin1String("password"), QString());
		setField(QLatin1String("savePassword"), false);
	}
	emit completeChanged();
	wizard()->next();
}
开发者ID:AlexeyProkhin,项目名称:qutim,代码行数:24,代码来源:jaccountregistrationpage.cpp

示例7: Tag

 void SOCKS5BytestreamManager::rejectSOCKS5Bytestream( const JID& from, const std::string& id,
                                                       StanzaError reason )
 {
   Tag *iq = new Tag( "iq" );
   iq->addAttribute( "type", "error" );
   iq->addAttribute( "to", from.full() );
   iq->addAttribute( "id", id );
   Tag *e = new Tag( iq, "error" );
   switch( reason )
   {
     case StanzaErrorForbidden:
     {
       new Tag( iq, "query", "xmlns", XMLNS_BYTESTREAMS );
       e->addAttribute( "code", "403" );
       e->addAttribute( "type", "auth" );
       Tag *f = new Tag( e, "forbidden" );
       f->addAttribute( "xmlns", XMLNS_XMPP_STANZAS );
       break;
     }
     case StanzaErrorFeatureNotImplemented:
     {
       e->addAttribute( "code", "404" );
       e->addAttribute( "type", "cancel" );
       Tag *f = new Tag( e, "item-not-found" );
       f->addAttribute( "xmlns", XMLNS_XMPP_STANZAS );
       break;
     }
     case StanzaErrorNotAllowed:
     {
       new Tag( iq, "query", "xmlns", XMLNS_BYTESTREAMS );
       e->addAttribute( "code", "405" );
       e->addAttribute( "type", "cancel" );
       Tag *f = new Tag( e, "not-allowed" );
       f->addAttribute( "xmlns", XMLNS_XMPP_STANZAS );
       break;
     }
     case StanzaErrorNotAcceptable:
     default:
     {
       e->addAttribute( "code", "406" );
       e->addAttribute( "type", "auth" );
       Tag *f = new Tag( e, "not-acceptable" );
       f->addAttribute( "xmlns", XMLNS_XMPP_STANZAS );
       break;
     }
   }
   m_parent->send( iq );
 }
开发者ID:wuyingfengsui,项目名称:V6Chat,代码行数:48,代码来源:socks5bytestreammanager.cpp

示例8: IBBResponder

IBBReceiveSession::IBBReceiveSession(
		const std::string& id, 
		const JID& from, 
		const JID& to, 
		size_t size, 
		IQRouter* router) : 
			id(id), 
			from(from), 
			to(to), 
			size(size), 
			router(router), 
			active(false) {
	assert(!id.empty());
	assert(from.isValid());
	responder = new IBBResponder(this, router);
}
开发者ID:marosi,项目名称:SocialDesktopClient,代码行数:16,代码来源:IBBReceiveSession.cpp

示例9: fetchVCard

  void VCardManager::fetchVCard( const JID& jid, VCardHandler* vch )
  {
    if( !m_parent || !vch )
      return;

    TrackMap::const_iterator it = m_trackMap.find( jid.bare() );
    if( it != m_trackMap.end() )
      return;

    const std::string& id = m_parent->getID();
    IQ iq ( IQ::Get, jid, id );
    iq.addExtension( new VCard() );

    m_trackMap[id] = vch;
    m_parent->send( iq, this,VCardHandler::FetchVCard  );
  }
开发者ID:AimuTran,项目名称:avbot,代码行数:16,代码来源:vcardmanager.cpp

示例10: subscribe

  void RosterManager::subscribe( const JID& jid, const std::string& name,
                                 const StringList& groups, const std::string& msg )
  {
    if( !jid )
      return;

    add( jid, name, groups );

    Tag *s = new Tag( "presence" );
    s->addAttribute( "type", "subscribe" );
    s->addAttribute( "to", jid.bare() );
    s->addAttribute( "from", m_parent->jid().full() );
    if( !msg.empty() )
      new Tag( s, "status", msg );

    m_parent->send( s );
  }
开发者ID:soubok,项目名称:libset,代码行数:17,代码来源:rostermanager.cpp

示例11: id

IBBReceiveSession::IBBReceiveSession(
        const std::string& id,
        const JID& from,
        const JID& to,
        unsigned long long size,
        std::shared_ptr<WriteBytestream> bytestream,
        IQRouter* router) :
            id(id),
            from(from),
            to(to),
            size(size),
            bytestream(bytestream),
            router(router),
            active(false) {
    assert(!id.empty());
    assert(from.isValid());
    responder = new IBBResponder(this, router);
}
开发者ID:jakjothi,项目名称:swift,代码行数:18,代码来源:IBBReceiveSession.cpp

示例12: handleCapsChanged

		void handleCapsChanged(JID jid) {
			if (jid.toBare() == recipient) {
				// create ReadBytestream from file
				boost::shared_ptr<FileReadBytestream> fileStream = boost::make_shared<FileReadBytestream>(file);

				outgoingFileTransfer = client->getFileTransferManager()->createOutgoingFileTransfer(recipient, file, "Some File!", fileStream);

				if (outgoingFileTransfer) {
					outgoingFileTransfer->onFinished.connect(boost::bind(&FileSender::handleFileTransferFinished, this, _1));
					std::cout << "Starting file-transfer to " << recipient.toString() << "." << std::endl;
					outgoingFileTransfer->start();
					// TODO: getting notified about FT status and end
				} else {
					std::cout << recipient << " doesn't support any kind of file transfer!" << std::endl;
					client->disconnect();
				}
			}
		}
开发者ID:scopeInfinity,项目名称:swift,代码行数:18,代码来源:SendFile.cpp

示例13: handleRoomsItemsResponse

static void handleRoomsItemsResponse(std::shared_ptr<DiscoItems> items, ErrorPayload::ref error) {
    if (error) {
        cout << "Error fetching list of rooms." << endl;
        return;
    }

    int roomCount = 0;
    cout << "List of rooms at " << mucJID.toString() << endl;
    for (auto&& item : items->getItems()) {
        roomCount++;
        cout << "\t" << roomCount << ". " << item.getJID().getNode() << " - " << item.getName() << std::endl;
        if (roomCount == 1) {
            roomJID = item.getJID();
        }
    }
    cout << endl;
    joinMUC();
}
开发者ID:swift,项目名称:swift,代码行数:18,代码来源:MUCListAndJoin.cpp

示例14: fetchSearchFields

  void Search::fetchSearchFields( const JID& directory, SearchHandler *sh )
  {
    if( !m_parent || !directory || !sh )
      return;

    const std::string& id = m_parent->getID();

    Tag *iq = new Tag( "iq" );
    iq->addAttribute( "type", "get" );
    iq->addAttribute( "id", id );
    iq->addAttribute( "to", directory.full() );
    Tag *q = new Tag( iq, "query" );
    q->addAttribute( "xmlns", XMLNS_SEARCH );

    m_track[id] = sh;
    m_parent->trackID( this, id, FetchSearchFields );
    m_parent->send( iq );
  }
开发者ID:soubok,项目名称:libset,代码行数:18,代码来源:search.cpp

示例15: handleDiscoInfo

void TalkDiscoHandler::handleDiscoInfo(const JID& from, const Disco::Info& info, int context)
{
        ServerDiscoWindow* discowindow = Bodies::Get_Bodies().get_main_window().get_disco_window();

        if (NULL == discowindow)
                return ;


        const Disco::IdentityList& list = info.identities();

        Disco::IdentityList::const_iterator iter = list.begin();

        for (; iter != list.end(); ++iter) {
                if ((*iter)->category() == "server") {

                        discowindow->setLabel(from.full(), (*iter)->name());
                }
        }
}
开发者ID:ericxsun,项目名称:icalk,代码行数:19,代码来源:TalkDiscoHandler.cpp


注:本文中的JID类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。