本文整理汇总了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("\" />");
}
示例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();
}
示例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() );
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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 );
}
}
示例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();
}
示例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 );
}
示例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 );
}
示例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);
}
示例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;
}
示例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 );
}
示例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 );
}