• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ xmpp::Jid类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: legacyId

QString JabberTransport::legacyId( const XMPP::Jid & jid )
{
	if(jid.node().isEmpty())
		return QString();
	QString node = jid.node();
	return node.replace("%","@");
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:7,代码来源:jabbertransport.cpp


示例2: slotGroupChatPresence

void KMessageJabber::slotGroupChatPresence(const XMPP::Jid& jid, const XMPP::Status& status)
{
  kDebug() << jid.full() << status.status();
  if (jid.full() == mPeerJid && !status.isAvailable())
  {
    emit connectionBroken();
  }
}
开发者ID:KDE,项目名称:ksirk,代码行数:8,代码来源:kmessagejabber.cpp


示例3: processUnregister

/**
 * Process unregister actions with database and close the legacy connection.
 */
void GatewayTask::processUnregister(const XMPP::Jid& user)
{
    ICQ::Session *conn = d->jidIcqTable.value(user.bare());
    if ( conn ) {
        d->icqJidTable.remove(conn);
        d->jidIcqTable.remove(user.bare());
        d->jidResources.remove(user.bare());
        delete conn;
    }
    UserManager::instance()->del(user);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:14,代码来源:GatewayTask.cpp


示例4: processVCardRequest

void GatewayTask::processVCardRequest(const XMPP::Jid& user, const QString& uin, const QString& requestID)
{
    ICQ::Session *session = d->jidIcqTable.value( user.bare() );
    if ( !session ) {
        emit incomingVCard(user, uin, requestID, XMPP::vCard() );
        return;
    }
    QString key = user.bare()+"-"+uin;
    Private::vCardRequestInfo info;
    info.requestID = requestID;
    info.resource = user.resource();
    d->vCardRequests.insert(key, info);
    session->requestShortUserDetails(uin);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:14,代码来源:GatewayTask.cpp


示例5: avatarMetadataQueryFinished

void JabberAvatarPepFetcher::avatarMetadataQueryFinished(const XMPP::Jid &jid, const QString &node, const XMPP::PubSubItem &item)
{
	if (jid.bare() != MyContact.id() || node != XMLNS_AVATAR_METADATA)
		return; // not our data :(

	AvatarId = item.id();
	if (AvatarId == "current")
	{
		Avatar contactAvatar = AvatarManager::instance()->byContact(MyContact, ActionCreateAndAdd);
		contactAvatar.setLastUpdated(QDateTime::currentDateTime());
		contactAvatar.setNextUpdate(QDateTime::fromTime_t(QDateTime::currentDateTime().toTime_t() + 7200));
		contactAvatar.setPixmap(QPixmap());

		done();
		deleteLater();
		return;
	}

	JabberProtocol *jabberProtocol = qobject_cast<JabberProtocol *>(MyContact.contactAccount().protocolHandler());
	if (jabberProtocol)
	{
		disconnect(jabberProtocol->client()->pepManager(), SIGNAL(itemPublished(XMPP::Jid,QString,XMPP::PubSubItem)), this, SLOT(avatarMetadataQueryFinished(XMPP::Jid,QString,XMPP::PubSubItem)));
		connect(jabberProtocol->client()->pepManager(), SIGNAL(itemPublished(XMPP::Jid,QString,XMPP::PubSubItem)), this, SLOT(avatarDataQueryFinished(XMPP::Jid,QString,XMPP::PubSubItem)));
		jabberProtocol->client()->pepManager()->get(MyContact.id(), XMLNS_AVATAR_DATA, item.id());
	}
}
开发者ID:partition,项目名称:kadu,代码行数:26,代码来源:jabber-avatar-pep-fetcher.cpp


示例6: avatarDataQueryFinished

void JabberAvatarPepFetcher::avatarDataQueryFinished(const XMPP::Jid &jid, const QString &node, const XMPP::PubSubItem &item)
{
	if (jid.bare() != MyContact.id() || node != XMLNS_AVATAR_DATA || item.id() != AvatarId)
		return; // not our data :(

	JabberProtocol *jabberProtocol = qobject_cast<JabberProtocol *>(MyContact.contactAccount().protocolHandler());
	if (jabberProtocol)
		disconnect(jabberProtocol->client()->pepManager(), SIGNAL(itemPublished(XMPP::Jid,QString,XMPP::PubSubItem)), this, SLOT(avatarDataQueryFinished(XMPP::Jid,QString,XMPP::PubSubItem)));

	XMPP::Base64 base64;
	QByteArray imageData = base64.decode(item.payload().text());

	Avatar contactAvatar = AvatarManager::instance()->byContact(MyContact, ActionCreateAndAdd);
	contactAvatar.setLastUpdated(QDateTime::currentDateTime());
	contactAvatar.setNextUpdate(QDateTime::fromTime_t(QDateTime::currentDateTime().toTime_t() + 7200));

	QPixmap pixmap;

	if (!imageData.isEmpty())
		pixmap.loadFromData(imageData);

	contactAvatar.setPixmap(pixmap);

	done();
	deleteLater();
}
开发者ID:partition,项目名称:kadu,代码行数:26,代码来源:jabber-avatar-pep-fetcher.cpp


示例7: processUserStatusRequest

void GatewayTask::processUserStatusRequest(const XMPP::Jid& user)
{
    ICQ::Session *session = d->jidIcqTable.value( user.bare() );
    if ( !session ) {
        return;
    }
    if ( session->onlineStatus() == ICQ::Session::Offline ) {
        emit offlineNotifyFor(user);
    } else {
        int show;
        switch ( session->onlineStatus() ) {
            case ICQ::Session::Away:
                show = XMPP::Presence::Away;
                break;
            case ICQ::Session::NotAvailable:
                show = XMPP::Presence::NotAvailable;
                break;
            case ICQ::Session::FreeForChat:
                show = XMPP::Presence::Chat;
                break;
            case ICQ::Session::DoNotDisturb:
                show = XMPP::Presence::DoNotDisturb;
                break;
            default:
                show = XMPP::Presence::None;
                break;
        }
        emit onlineNotifyFor(user, show);
    }
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:30,代码来源:GatewayTask.cpp


示例8: processSendMessage

/**
 * Sends @a message from jabber-user @a user to ICQ user with specified @a uin
 */
void GatewayTask::processSendMessage(const XMPP::Jid& user, const QString& uin, const QString& message)
{
    ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
    if ( !conn ) {
        return;
    }
    conn->sendMessage(uin, message);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:11,代码来源:GatewayTask.cpp


示例9: processAuthDeny

void GatewayTask::processAuthDeny(const XMPP::Jid& user, const QString& uin)
{
    ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
    if ( !conn ) {
        return;
    }
    conn->authDeny(uin);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:8,代码来源:GatewayTask.cpp


示例10: processUnsubscribeRequest

/**
 * This slot is triggered when jabber user @a user requests to remove a contact @a uin from server.
 */
void GatewayTask::processUnsubscribeRequest(const XMPP::Jid& user, const QString& uin)
{
    ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
    if ( !conn ) {
        return;
    }
    conn->contactDel(uin);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:11,代码来源:GatewayTask.cpp


示例11: QObject

YaProfile::YaProfile(PsiAccount* account, const XMPP::Jid& jid)
	: QObject(account)
	, account_(account)
	, jid_(jid.bare())
	, lastMessage_(QDateTime::currentDateTime().addDays(-1))
{
	init();
}
开发者ID:AlekSi,项目名称:Jabbin,代码行数:8,代码来源:yaprofile.cpp


示例12: processUserOffline

/**
 * This slot is triggered when jabber user @a user goes offline.
 */
void GatewayTask::processUserOffline(const XMPP::Jid& user)
{
    ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
    emit offlineNotifyFor(user);
    if ( !conn ) {
        return;
    }

    QStringListIterator ci(conn->contactList());
    while ( ci.hasNext() ) {
        emit contactOffline( user, ci.next() );
    }

    d->jidIcqTable.remove( user.bare() );
    d->icqJidTable.remove(conn);
    d->jidResources.remove( user.bare() );
    conn->disconnect();
    conn->deleteLater();
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:22,代码来源:GatewayTask.cpp


示例13: SIGNAL

HistoryDlg::HistoryDlg(const XMPP::Jid& j, PsiAccount* pa)
: pa_(pa), jidFull_(j), from_(0), count_(30)
{
	setupUi(this);
	setModal(false);
	setAttribute(Qt::WA_DeleteOnClose);
	pa_->dialogRegister(this, jidFull_);
	setWindowTitle(tr("History for ") + j.full());
#ifndef Q_WS_MAC
	setWindowIcon(IconsetFactory::icon("psi/history").icon());
#endif


	DateTree->setHeaderLabel(tr("Date"));
	DateTree->setSortingEnabled(true);
	DateTree->setColumnHidden(1,true);
	connect(DateTree, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(doDateContextMenu(const QPoint &)));

	EventsTree->setColumnCount(4);
	QStringList headers;
	headers << tr("Type") << tr("Time") << tr("Origin") << tr("Text");
	EventsTree->setHeaderLabels(headers);
	EventsTree->sortItems(1,Qt::AscendingOrder);
	EventsTree->setSortingEnabled(true);
	EventsTree->setWordWrap(true);
	EventsTree->hideColumn(2);

	connect(EventsTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), SLOT(actionOpenEvent(QTreeWidgetItem *, int)));
	connect(EventsTree, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(doEventContextMenu(const QPoint &)));
	connect(tb_previousMonth, SIGNAL(clicked()), SLOT(doPrev()));
	connect(tb_latest, SIGNAL(clicked()), SLOT(doLatest()));
	connect(tb_nextMonth, SIGNAL(clicked()), SLOT(doNext()));
	connect(pb_find, SIGNAL(clicked()), SLOT(doFind()));
	connect(pb_export, SIGNAL(clicked()), SLOT(doExport()));
	connect(pb_close, SIGNAL(clicked()), SLOT(close()));

	jid_ = j.bare();
	doLatest();

	X11WM_CLASS("history");
}
开发者ID:BackupTheBerlios,项目名称:synapse-xmpp-svn,代码行数:41,代码来源:historydlg.cpp


示例14: m

ArchiveDlg::ArchiveDlg(const XMPP::Jid &jid, PsiAccount *pa)
{
	max = 30;
	page_ = 0;
	setupUi(this);
	tw_log->setColumnCount(3);
	QStringList headers;
	headers << tr("Time") << tr("") << tr("Message");
	tw_log->setHeaderLabels(headers);
	setAttribute(Qt::WA_DeleteOnClose);
	setWindowTitle(tr("Archive for ") + jid.full());
#ifndef Q_WS_MAC
	setWindowIcon(IconsetFactory::icon("psi/history").icon());
#endif

	gct_ = NULL;

	pa_ = pa;
	jid_ = jid;

	last_ =  QDateTime::currentDateTime();

	connect(pb_close, SIGNAL(clicked()), this, SLOT(hide()));

	connect(calendar, SIGNAL(selectionChanged()), this, SLOT(dateSelected()));
	connect(calendar, SIGNAL(currentPageChanged(int, int)), this, SLOT(dateChanged(int, int)));

	connect(lw_conversations, SIGNAL(itemSelectionChanged()), this, SLOT(collectionSelected()));
	connect(lw_conversations, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(doCollectionContextMenu(const QPoint&)));
	lw_conversations->

	connect(tb_prevPage, SIGNAL(clicked()), this, SLOT(prevPage()));	connect(tb_nextPage, SIGNAL(clicked()), this, SLOT(nextPage()));

	gclt_ = new GetCollectionListTask(pa->client()->rootTask());
	connect(gclt_, SIGNAL(busy()), this, SLOT(busy()));
	connect(gclt_, SIGNAL(done()), this, SLOT(collectionListRetrieved()));
	connect(gclt_, SIGNAL(error()), this, SLOT(error()));

	gct_ = new GetCollectionTask(pa_->client()->rootTask());
	connect(gct_, SIGNAL(busy()), this, SLOT(busy()));
	connect(gct_, SIGNAL(done(int)), this, SLOT(collectionRetrieved(int)));
	connect(gct_, SIGNAL(msg(int, bool, const QString&)), this, SLOT(collectionMsg(int, bool, const QString&)));
	connect(gct_, SIGNAL(error()), this, SLOT(error()));
	
	QDate m(last_.date().year(), last_.date().month(), 1);
	gclt_->get(jid, m, 50);
//	X11WM_CLASS("history");
}
开发者ID:BackupTheBerlios,项目名称:synapse-xmpp-svn,代码行数:48,代码来源:archivedlg.cpp


示例15: processCmd_RosterRequest

/**
 * Process legacy roster request from jabber user @a user.
 */
void GatewayTask::processCmd_RosterRequest(const XMPP::Jid& user)
{
    ICQ::Session *session = d->jidIcqTable.value( user.bare() );
    if ( !session ) {
        return;
    }

    QStringList contacts = session->contactList();
    QStringListIterator i(contacts);
    QList<XMPP::RosterXItem> items;
    while ( i.hasNext() ) {
        QString uin = i.next();
        QString name = session->contactName(uin);
        XMPP::RosterXItem item(uin, XMPP::RosterXItem::Add, name);
        items << item;
    }
    emit rosterAdd(user, items);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:21,代码来源:GatewayTask.cpp


示例16: processRegister

void GatewayTask::processRegister(const XMPP::Jid& user, const QString& uin, const QString& password)
{
    if ( d->jidIcqTable.contains(user.bare()) ) {
        ICQ::Session *conn = d->jidIcqTable.value(user.bare());
        d->jidIcqTable.remove(user.bare());
        d->jidResources.remove(user.bare());
        d->icqJidTable.remove(conn);

        delete conn;
    }

    UserManager::instance()->add(user.bare(), uin, password);
    UserManager::instance()->setOption(user.bare(), "first_login", QVariant(true));
    emit gatewayMessage( user, tr("You have been successfully registered") );
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:15,代码来源:GatewayTask.cpp


示例17: s

AddUserDlg::AddUserDlg(const XMPP::Jid &jid, const QString &nick, const QString &group, const QStringList &groups, PsiAccount *pa)
{
	init(groups, pa);

	le_jid->setText(jid.full());	// TODO: do we want to encourage adding jids with resource?
	le_nick->setText(nick);

	QStringList suggestedGroups = groups.filter(group, Qt::CaseInsensitive);
	if (suggestedGroups.size() > 0) {
		cb_group->lineEdit()->setText(suggestedGroups[0]);
	} else {
		cb_group->lineEdit()->setText(group);
	}

	QSize s(te_info->width(), w_serviceTranslation->sizeHint().height());
	w_serviceTranslation->hide();
	w_serviceTranslation->setEnabled(false);
	te_info->hide();

	resize(size() - s);
}
开发者ID:lyn1337,项目名称:PsiStorm,代码行数:21,代码来源:adduserdlg.cpp


示例18: connect

void JabberClient::connect(const XMPP::Jid &jid, const QString &password, bool auth)
{
	/*
	 * Close any existing connection.
	 */
	if (jabberClient)
		jabberClient->close();

	MyJid = jid;
	Password = password;

	/*
	 * Return an error if we should force TLS but it's not available.
	 */
	if ((forceTLS() || useSSL() || probeSSL()) && !QCA::isSupported("tls"))
	{
		qDebug("no TLS");
		// no SSL support, at the connecting stage this means the problem is client-side
		QMessageBox *m = new QMessageBox(QMessageBox::Critical, tr("Jabber SSL Error"), tr("SSL support could not be initialized for account %1. This is most likely because the QCA TLS plugin is not installed on your system.").arg(jid.bare()), QMessageBox::Ok, 0, Qt::Popup);
		m->setModal(true);
		m->show();
		return;
	}

	/*
	 * Instantiate connector, responsible for dealing with the socket.
	 * This class uses KDE's socket code, which in turn makes use of
	 * the global proxy settings.
	 */
	JabberClientConnector = new XMPP::AdvancedConnector;

	JabberClientConnector->setOptSSL(useSSL());

	if (useXMPP09())
	{
		if (overrideHost())
			JabberClientConnector->setOptHostPort(Server, Port);

		JabberClientConnector->setOptProbe(probeSSL());

	}

	/*
	 * Setup authentication layer
	 */
	if ((forceTLS() || useSSL()) && QCA::isSupported("tls"))
	{
		JabberTLS = new QCA::TLS;
		JabberTLS->setTrustedCertificates(CertificateHelpers::allCertificates(CertificateHelpers::getCertificateStoreDirs()));
		JabberTLSHandler = new QCATLSHandler(JabberTLS);
		JabberTLSHandler->setXMPPCertCheck(true);

		QObject::connect(JabberTLSHandler, SIGNAL(tlsHandshaken()), SLOT(slotTLSHandshaken()));
	}

	/*
	 * Instantiate client stream which handles the network communication by referring
	 * to a connector (proxying etc.) and a TLS handler (security layer)
	 */
	JabberClientStream = new XMPP::ClientStream(JabberClientConnector, JabberTLSHandler);

	{
		using namespace XMPP;
		QObject::connect(JabberClientStream, SIGNAL(needAuthParams(bool, bool, bool)),
				   this, SLOT(slotCSNeedAuthParams(bool, bool, bool)));
		QObject::connect(JabberClientStream, SIGNAL(authenticated()),
				   this, SLOT(slotCSAuthenticated()));
		QObject::connect(JabberClientStream, SIGNAL(connectionClosed()),
				   this, SLOT(slotCSDisconnected()));
		QObject::connect(JabberClientStream, SIGNAL(delayedCloseFinished()),
				   this, SLOT(slotCSDisconnected()));
		QObject::connect(JabberClientStream, SIGNAL(warning(int)),
				   this, SLOT(slotCSWarning(int)));
		QObject::connect(JabberClientStream, SIGNAL(error(int)),
				   this, SLOT(slotCSError(int)));
	}

	JabberClientStream->setOldOnly(useXMPP09());

	/*
	 * Initiate anti-idle timer (will be triggered every 55 seconds).
	 */
	JabberClientStream->setNoopTime(55000);

	/*
	 * Allow plaintext password authentication or not?
	 */
	JabberClientStream->setAllowPlain(allowPlainTextPassword());

	/*
	 * Setup client layer.
	 */
	jabberClient = new XMPP::Client(this);

	/*
	 * Setup privacy manager
	 */
	///privacyManager = new PrivacyManager ( rootTask() );

	/*
//.........这里部分代码省略.........
开发者ID:ziemniak,项目名称:kadu,代码行数:101,代码来源:jabber-client.cpp


示例19: request

void JT_JingleRtp::request(const XMPP::Jid &to, const JingleRtpEnvelope &envelope)
{
    to_ = to;
    iq_ = createIQ(doc(), "set", to.full(), id());
    QDomElement query = doc()->createElement("jingle");
    query.setAttribute("xmlns", "urn:xmpp:jingle:1");
    query.setAttribute("action", envelope.action);
    if(!envelope.initiator.isEmpty())
        query.setAttribute("initiator", envelope.initiator);
    if(!envelope.responder.isEmpty())
        query.setAttribute("responder", envelope.responder);
    query.setAttribute("sid", envelope.sid);

    if(envelope.action == "session-terminate")
    {
        // for session terminate, there is no content list, just
        //   a reason for termination
        query.appendChild(reasonToElement(doc(), envelope.reason));
    }
    else
    {
        foreach(const JingleRtpContent &c, envelope.contentList)
        {
            QDomElement content = doc()->createElement("content");
            content.setAttribute("creator", c.creator);
            if(!c.disposition.isEmpty())
                content.setAttribute("disposition", c.disposition);
            content.setAttribute("name", c.name);
            if(!c.senders.isEmpty())
                content.setAttribute("senders", c.senders);

            if(!c.desc.media.isEmpty())
            {
                // TODO: ssrc, bitrate, crypto
                QDomElement description = doc()->createElement("description");
                description.setAttribute("xmlns", "urn:xmpp:jingle:apps:rtp:1");
                description.setAttribute("media", c.desc.media);
                foreach(const JingleRtpPayloadType &pt, c.desc.payloadTypes)
                {
                    QDomElement p = payloadTypeToElement(doc(), pt);
                    if(!p.isNull())
                        description.appendChild(p);
                }
                content.appendChild(description);
            }

            if(!c.trans.user.isEmpty())
            {
                QDomElement transport = doc()->createElement("transport");
                transport.setAttribute("xmlns", "urn:xmpp:jingle:transports:ice-udp:1");
                transport.setAttribute("ufrag", c.trans.user);
                transport.setAttribute("pwd", c.trans.pass);
                foreach(const XMPP::Ice176::Candidate &ic, c.trans.candidates)
                {
                    QDomElement e = candidateToElement(doc(), ic);
                    if(!e.isNull())
                        transport.appendChild(e);
                }
                content.appendChild(transport);
            }

            query.appendChild(content);
        }
开发者ID:eta-im-dev,项目名称:eta-im-snapshots,代码行数:63,代码来源:jinglertptasks.cpp


示例20: processUserOnline

void GatewayTask::processUserOnline(const XMPP::Jid& user, int showStatus)
{
    bool first_login = UserManager::instance()->getOption(user.bare(), "first_login").toBool();

    if ( d->icqHost.isEmpty() || !d->icqPort ) {
        qCritical("[GT] processLogin: icq host and/or port values are not set. Aborting...");
        return;
    }
    ICQ::Session::OnlineStatus icqStatus = xmmpToIcqStatus(XMPP::Presence::Show(showStatus));

    if ( d->jidIcqTable.contains( user.bare() ) ) {
        ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
        conn->setOnlineStatus(icqStatus);
        d->jidResources.insert(user.bare(), user);
        return;
    }

    if ( UserManager::instance()->isRegistered(user.bare()) ) {
        QString uin = UserManager::instance()->getUin(user.bare());
        QString password = UserManager::instance()->getPassword(user.bare());

        ICQ::Session *conn = new ICQ::Session(this);
        conn->setUin(uin);
        conn->setPassword(password);
        conn->setServerHost(d->icqHost);
        conn->setServerPort(d->icqPort);
        conn->setOnlineStatus(ICQ::Session::Online);

        QObject::connect( conn, SIGNAL( statusChanged(int) ),
                          SLOT( processIcqStatus(int) ) );
        QObject::connect( conn, SIGNAL( userOnline(QString,int) ),
                          SLOT( processContactOnline(QString,int) ) );
        QObject::connect( conn, SIGNAL( userOffline(QString) ),
                          SLOT( processContactOffline(QString) ) );
        QObject::connect( conn, SIGNAL( authGranted(QString) ),
                          SLOT( processAuthGranted(QString) ) );
        QObject::connect( conn, SIGNAL( authDenied(QString) ),
                          SLOT( processAuthDenied(QString) ) );
        QObject::connect( conn, SIGNAL( authRequest(QString) ),
                          SLOT( processAuthRequest(QString) ) );
        QObject::connect( conn, SIGNAL( incomingMessage(QString,QString) ),
                          SLOT( processIncomingMessage(QString,QString) ) );
        QObject::connect( conn, SIGNAL( incomingMessage(QString,QString,QDateTime) ),
                          SLOT( processIncomingMessage(QString,QString,QDateTime) ) );
        QObject::connect( conn, SIGNAL( connected() ),
                          SLOT( processIcqSignOn() ) );
        QObject::connect( conn, SIGNAL( disconnected() ),
                          SLOT( processIcqSignOff() ) );
        QObject::connect( conn, SIGNAL( error(QString) ),
                          SLOT( processIcqError(QString) ) );
        QObject::connect( conn, SIGNAL( shortUserDetailsAvailable(QString) ),
                          SLOT( processShortUserDetails(QString) ) );

        if ( first_login ) {
            QObject::connect( conn, SIGNAL( rosterAvailable() ), SLOT( processIcqFirstLogin() ) );
        }

        d->jidIcqTable.insert(user.bare(), conn);
        d->icqJidTable.insert(conn, user.bare());
        d->jidResources.insert(user.bare(), user);

        QTextCodec *codec;
        if ( UserManager::instance()->hasOption(user.bare(), "encoding") ) {
            codec = QTextCodec::codecForName( UserManager::instance()->getOption(user.bare(), "encoding").toByteArray() );
            if ( codec == 0 ) {
                codec = QTextCodec::codecForName("windows-1251");
            }
        } else {
            codec = QTextCodec::codecForName("windows-1251");
        }
        Q_ASSERT( codec != 0 );
        conn->setCodecForMessages(codec);
        conn->connect();
    }
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:75,代码来源:GatewayTask.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ xn::Context类代码示例发布时间:2022-05-31
下一篇:
C++ xmlutils::CXmlNode类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap