本文整理汇总了C++中JID::setUsername方法的典型用法代码示例。如果您正苦于以下问题:C++ JID::setUsername方法的具体用法?C++ JID::setUsername怎么用?C++ JID::setUsername使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JID
的用法示例。
在下文中一共展示了JID::setUsername方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Client
IMClient::IMClient(const tstring& username,
const tstring& resource,
const tstring& password,
const tstring& server,
const tstring& server_addr,
HWND hWnd,
bool bLog,
DWORD dwIdleTimeout)
{
TRY_CATCH
m_hWnd = hWnd;
JID jid;
jid.setUsername( username.c_str() );
jid.setResource( resource.c_str() );
jid.setServer(server.c_str());
m_server = server;
m_client = new Client(jid, password.c_str());
m_client->registerConnectionListener(this);
m_client->setServer( server_addr.c_str());
// Todo we do not want auto presence - we will need to set presence after
// connect due status selected by user
// m_client->setAutoPresence(true);
// m_client->setInitialPriority(4); removed in gloox 0.9
m_client->disco()->setVersion( _T("messageTest"), GLOOX_VERSION, _T("Linux") );
m_client->disco()->setIdentity( _T("client"), _T("bot") );
//
// Our simple client version not requires Sessions
// The messages will be handled in the blocked handleMessage() function
m_client->registerMessageHandler(this);
//
// We will log this
if( bLog )
registerLogHandler();
//
// Register this bject to receive updates on roster operations
// todo for future versions
// m_client->rosterManager()->registerRosterListener( this );
m_client->setTls(true);
//
//
m_bOnDisconnectCalled = FALSE;
//
//
m_bDisconnected = FALSE;
CATCH_THROW(_T("IMClient::IMClient"))
}