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


C++ JID::full方法代码示例

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


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

示例1: sendPresence

void Component::sendPresence(JID & from, JID & to) {
	send("<presence from=\"");
	send(from.full());
	send("\" to=\"");
	send(to.full());
	send("\" />");
}
开发者ID:WST,项目名称:xpbot,代码行数:7,代码来源:component.cpp

示例2: on_lineEdit_textChanged

void XmlConsole::on_lineEdit_textChanged(const QString &text)
{
	int filterType = m_filter & 0xf0;
	JID filterJid = (filterType == ByJid) ? text : QString();
    for (int i = 0; i < m_nodes.size(); i++) {
		XmlNode &node = m_nodes[i];
		bool ok = true;
		switch (filterType) {
		case ByXmlns:
			ok = node.xmlns.contains(text);
			break;
		case ByJid:
			ok = node.jid.full() == filterJid.full() || node.jid.bare() == filterJid.full();
			break;
		case ByAllAttributes:
			ok = node.attributes.contains(text);
			break;
		default:
			break;
		}
		ok &= bool(node.type & m_filter);
		node.block.setVisible(ok);
		node.block.setLineCount(ok ? node.lineCount : 0);
		//		qDebug() << node.block.lineCount();
	}
	QAbstractTextDocumentLayout *layout = m_ui->xmlBrowser->document()->documentLayout();
	Q_ASSERT(qobject_cast<QPlainTextDocumentLayout*>(layout));
	qobject_cast<QPlainTextDocumentLayout*>(layout)->requestUpdate();
}
开发者ID:andrix,项目名称:tomahawk,代码行数:29,代码来源:xmlconsole.cpp

示例3: handleAdhocCommand

 virtual void handleAdhocCommand( const JID& from, const Adhoc::Command& command,
                                  const std::string& /*sess*/ )
 {
     if( command.node() == "helloworld" )
         printf( "Hello World!, by %s\n", from.full().c_str() );
     else if( command.node() == "config" )
         printf( "configuration command called by %s\n", from.full().c_str() );
     else if( command.node() == "shutdown" )
     {
         printf( "shutting down, by %s\n", from.full().c_str() );
     }
 }
开发者ID:junction,项目名称:jn-tapi,代码行数:12,代码来源:adhoc_example.cpp

示例4: Tag

  bool SOCKS5BytestreamManager::requestSOCKS5Bytestream( const JID& to, S5BMode /*mode*/,
                                                         const std::string& sid )
  {
    if( !m_parent )
      return false;

    if( m_hosts.empty() )
    {
      m_parent->logInstance().log( LogLevelWarning, LogAreaClassS5BManager,
                                   "No stream hosts set, cannot request bytestream." );
      return false;
    }

    const std::string& msid = sid.empty() ? m_parent->getID() : sid;
    const std::string& id = m_parent->getID();
    Tag *iq = new Tag( "iq" );
    iq->addAttribute( "type", "set" );
    iq->addAttribute( "to", to.full() );
    iq->addAttribute( "id", id );
    Tag *q = new Tag( iq, "query", "xmlns", XMLNS_BYTESTREAMS );
    q->addAttribute( "sid", msid );
    q->addAttribute( "mode", /*( mode == S5BTCP ) ?*/ "tcp" /*: "udp"*/ );

    StreamHostList::const_iterator it = m_hosts.begin();
    for( ; it != m_hosts.end(); ++it )
    {
      Tag* s = new Tag( q, "streamhost", "jid", (*it).jid.full() );
      s->addAttribute( "host", (*it).host );
      s->addAttribute( "port", (*it).port );
    }

    if( m_server )
    {
      SHA sha;
      sha.feed( msid );
      sha.feed( m_parent->jid().full() );
      sha.feed( to.full() );
      m_server->registerHash( sha.hex() );
    }

    AsyncS5BItem asi;
    asi.sHosts = m_hosts;
    asi.id = id;
    asi.from = to;
    asi.incoming = false;
    m_asyncTrackMap[msid] = asi;

    m_trackMap[id] = msid;
    m_parent->trackID( this, id, S5BOpenStream );
    m_parent->send( iq );

    return true;
  }
开发者ID:wuyingfengsui,项目名称:V6Chat,代码行数:53,代码来源:socks5bytestreammanager.cpp

示例5: handleFTRequest

void jFileTransfer::handleFTRequest (const JID &from, const JID &, const std::string &sid, const std::string &name, long size, const std::string &hash, const std::string &date, const std::string &mimetype, const std::string &desc, int stypes)
{    
	qDebug() << "handleFTRequest" << utils::fromStd(from.full()) << utils::fromStd(sid) << (int)stypes;
	if( !stypes & (SIProfileFT::FTTypeS5B | SIProfileFT::FTTypeIBB) )
	{
		m_ft->declineFT(from, sid, SIManager::NoValidStreams);
		return;
	}
	jFileTransferWidget *ft_widget = new jFileTransferWidget(false, this, m_ft, from, sid, name, size, hash, date, mimetype, desc, stypes);
	m_ft_widgets[utils::fromStd(sid+"@"+from.full())] = ft_widget;
	(new jFileTransferRequest(this, ft_widget, m_ft, from, sid, name, size, hash, date, mimetype, desc, stypes))->show();
}
开发者ID:veksha,项目名称:vekshas-qutim-protocols,代码行数:12,代码来源:jFileTransfer.cpp

示例6: iq

bool SOCKS5BytestreamManager::requestSOCKS5Bytestream( const JID& to, S5BMode mode,
        const std::string& sid,
        const JID& from )
{
    if( !m_parent )
    {
        m_parent->logInstance().warn( LogAreaClassS5BManager,
                                      "No parent (ClientBase) set, cannot request bytestream." );
        return false;
    }

    if( m_hosts.empty() )
    {
        m_parent->logInstance().warn( LogAreaClassS5BManager,
                                      "No stream hosts set, cannot request bytestream." );
        return false;
    }

    const std::string& msid = sid.empty() ? m_parent->getID() : sid;
    const std::string& id = m_parent->getID();
    IQ iq( IQ::Set, to, id );
    iq.addExtension( new Query( msid, mode, m_hosts ) );
    if( from )
        iq.setFrom( from );

    if( m_server )
    {
        SHA sha;
        sha.feed( msid );
        if( from )
            sha.feed( from.full() );
        else
            sha.feed( m_parent->jid().full() );
        sha.feed( to.full() );
        m_server->registerHash( sha.hex() );
    }

    AsyncS5BItem asi;
    asi.sHosts = m_hosts;
    asi.id = id;
    asi.from = to;
    asi.to = from ? from : m_parent->jid();
    asi.incoming = false;
    m_asyncTrackMap[msid] = asi;

    m_trackMap[id] = msid;
    m_parent->send( iq, this, S5BOpenStream );

    return true;
}
开发者ID:kofbashen,项目名称:weishao,代码行数:50,代码来源:socks5bytestreammanager.cpp

示例7: requestInBandBytestream

  bool InBandBytestreamManager::requestInBandBytestream( const JID& to, InBandBytestreamHandler *ibbh )
  {
    if( !m_parent || !ibbh )
      return false;

    const std::string sid = m_parent->getID();
    const std::string id = m_parent->getID();
    Tag *iq = new Tag( "iq" );
    iq->addAttribute( "type", "set" );
    iq->addAttribute( "to", to.full() );
    iq->addAttribute( "id", id );
    Tag *o = new Tag( iq, "open" );
    o->addAttribute( "sid", sid );
    o->addAttribute( "block-size", m_blockSize );
    o->addAttribute( "xmlns", XMLNS_IBB );

    TrackItem item;
    item.sid = sid;
    item.ibbh = ibbh;
    m_trackMap[id] = item;
    m_parent->trackID( this, id, IBBOpenStream );
    m_parent->send( iq );

    return true;
  }
开发者ID:SupportSpace,项目名称:SupportCenter,代码行数:25,代码来源:inbandbytestreammanager.cpp

示例8: handleVCard

    virtual void handleVCard( const JID& jid, const VCard *v )
    {
      ++m_count;
      if( !v )
      {
        printf( "empty vcard!\n" );
        return;
      }

      VCard* vcard = new VCard( *v );
      printf( "received vcard for %s: %s, %d\n", jid.full().c_str(), vcard->tag()->xml().c_str(), m_count );
      VCard::AddressList::const_iterator it = vcard->addresses().begin();
      for( ; it != vcard->addresses().end(); ++it )
      {
        printf( "address: %s\n", (*it).street.c_str() );
      }

      if( m_count > 2 )
        j->disconnect();
      else if( m_count == 1 )
      {
        VCard *v = new VCard();
        v->setFormattedname( "Hurk the Hurk" );
        v->setNickname( "hurkhurk" );
        v->setName( "Simpson", "Bart", "", "Mr.", "jr." );
        v->addAddress( "pobox", "app. 2", "street", "Springfield", "region", "123", "USA", VCard::AddrTypeHome );
        m_vManager->storeVCard( v, this );
        printf( "setting vcard: %s\n", v->tag()->xml().c_str() );
      }
      else
      {
        JID jid( "[email protected]" );
        m_vManager->fetchVCard( jid, this );
      }
    }
开发者ID:github188,项目名称:BasicFunctionCodeBase,代码行数:35,代码来源:vcard_example.cpp

示例9: ClientTest

 ClientTest( const JID& jid, const std::string& password, int port = -1 )
   : Client( jid, password, port ), m_connected( 0 ), m_disconnected( 0 ), m_log( false )
 {
   logInstance().registerLogHandler( LogLevelDebug, LogAreaAll, this );
   registerConnectionListener( this );
   jidCopy = jid.full();
 }
开发者ID:dvdjg,项目名称:GoapCpp,代码行数:7,代码来源:client_test.cpp

示例10: search

  void Search::search( const JID& directory, int fields, const SearchFieldStruct& values, SearchHandler *sh )
  {
    if( !m_parent || !directory || !sh )
      return;

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

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

    if( fields & SearchFieldFirst )
      new Tag( q, "first", values.first );
    if( fields & SearchFieldLast )
      new Tag( q, "last", values.last );
    if( fields & SearchFieldNick )
      new Tag( q, "nick", values.nick );
    if( fields & SearchFieldEmail )
      new Tag( q, "email", values.email );

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

示例11: QWidget

JidEdit::JidEdit( const JID &jid, QWidget *parent ) : QWidget(parent), j_ptr(new JidEditPrivate)
{
	J_D(JidEdit);
	j->line_edit = new LineEditHelper( utils::fromStd( jid.full() ), this );
	j->jid = jid;
	j->validator = new JidValidator( this );
	j->line_edit->setValidator( j->validator );
}
开发者ID:veksha,项目名称:vekshas-qutim-protocols,代码行数:8,代码来源:jidedit.cpp

示例12: s_conferenceInvite

void jConference::s_conferenceInvite(const JID &room, const JID &from, const QString &reason_sent, const QString &password)
{
	QString reason = reason_sent;
	if (reason.isEmpty())
		reason = "no reason";
	if (QMessageBox(QMessageBox::Question, tr("Invite to groupchat"), tr("User %1 invite you\nto conference %2\nwith reason \"%3\"\nAccept invitation?").arg(utils::fromStd(from.bare())).arg(utils::fromStd(room.full())).arg(reason), QMessageBox::Yes | QMessageBox::No).exec() == QMessageBox::Yes)
		joinGroupchat(utils::fromStd(room.full()), "", password, true);
}
开发者ID:veksha,项目名称:vekshas-qutim-protocols,代码行数:8,代码来源:jConference.cpp

示例13: removeWidget

void jFileTransfer::removeWidget(const JID &from, const std::string &sid, bool del, bool sending)
{
	jFileTransferWidget *ft_widget = m_ft_widgets.take(utils::fromStd(sid+"@"+from.full()));
	if(sending)
		jPluginSystem::instance().ftClosed();
	if(del)
		delete ft_widget;
}
开发者ID:veksha,项目名称:vekshas-qutim-protocols,代码行数:8,代码来源:jFileTransfer.cpp

示例14: acceptInBandBytestream

 void InBandBytestreamManager::acceptInBandBytestream( InBandBytestream *ibb,
     const JID& from, const std::string& id )
 {
   m_ibbMap[ibb->sid()] = ibb;
   Tag *iq = new Tag( "iq" );
   iq->addAttribute( "type", "result" );
   iq->addAttribute( "to", from.full() );
   iq->addAttribute( "id", id );
   m_parent->send( iq );
 }
开发者ID:SupportSpace,项目名称:SupportCenter,代码行数:10,代码来源:inbandbytestreammanager.cpp

示例15: handleFTRequest

 virtual void handleFTRequest( const JID& from, const std::string& id, const std::string& name,
                               long size, const std::string& hash,
                               const std::string& date, const std::string& mimetype,
                               const std::string& desc, int /*stypes*/, long /*offset*/, long /*length*/ )
 {
   printf( "received ft request from %s: %s (%ld bytes). hash: %s, date: %s, mime-type: %s\ndesc: %s\n",
           from.full().c_str(), name.c_str(), size, hash.c_str(), date.c_str(), mimetype.c_str(),
           desc.c_str() );
   f->acceptFT( from, id, SIProfileFT::FTTypeS5B );
 }
开发者ID:SupportSpace,项目名称:SupportCenter,代码行数:10,代码来源:ft_recv.cpp


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