Пример #1
0
void WsAccount::parseSet( TiXmlNode* syncNode, IMAccountList& imAccountList )
{
	TiXmlNode*  networkNode = NULL;

	IMAccount imAccount;
	_userProfile.initImAccountParameters( &imAccount );

	IMAccountXMLSerializer serializer( imAccount );
	TiXmlHandle h(syncNode);
	serializer.unserializeWebService(h, imAccount.getIMAccountParameters() );

	//VOXOX - JRT - 2009.06.02  we currently get empty node if no UserNetworks exist on server.
	if ( imAccount.getProtocol() != EnumIMProtocol::IMProtocolUnknown )
	{
		//VOXOX - JRT - 2009.07.13 - HACK to remove old voxox domain accounts.
		if ( !imAccount.isOldVoxOxDomain() )	//Just throw this away.
		{
			imAccountList.Add( &imAccount );
		}
	}
	else
	{
		int xxx = 1;	//TODO: we get here is network already exists and was 'saved' with NID == 0.
	}
}
Пример #2
0
void IMAccountList::getIMAccountsOfProtocolVector( std::vector<EnumIMProtocol::IMProtocol> protocols, IMAccountList& rResult )
{
	RecursiveMutex::ScopedLock lock( _mutex );	//VOXOX - JRT - 2009.07.13 

	for (IMAccountList::const_iterator it = begin(); it != end(); ++it) 
	{
		for( std::vector<EnumIMProtocol::IMProtocol>::const_iterator itv = protocols.begin(); itv != protocols.end(); ++itv ) 
		{
			if (it->second.getProtocol() == (*itv)) 
			{
				rResult.Add( const_cast<IMAccount&>(it->second) );
				break;
			}
		}
	}
}
Пример #3
0
void IMAccountList::getIMAccountsOfQtProtocol(QtEnumIMProtocol::IMProtocol protocol, IMAccountList& rResult )
{
	RecursiveMutex::ScopedLock lock( _mutex );	//VOXOX - JRT - 2009.07.13 

	for ( const_iterator it = begin(); it != end(); ++it ) 
	{
		// FIXME: line 50 and 51 should not be there.
		// There are here for compatibility with previous version of WengoPhone.
		QtEnumIMProtocol::IMProtocol accountProtocol = it->second.getQtProtocol();

		if ( accountProtocol == protocol) 
		{
			rResult.Add( const_cast<IMAccount&>(it->second) );
		}
	}
}
Пример #4
0
IMAccountList QtAddIMContact::getSelectedIMAccounts(EnumIMProtocol::IMProtocol imProtocol) const {
	IMAccountList result;

	IMAccountList imAccounts = _cUserProfile.getUserProfile().getIMAccountManager().getIMAccountsOfProtocol(imProtocol);

	for (IMAccountList::const_iterator it = imAccounts.begin();
		it != imAccounts.end(); ++it) {

//		QList<QTreeWidgetItem *> list = _ui->treeWidget->findItems(QString::fromStdString((*it).getLogin()), Qt::MatchExactly, 1);	//VOXOX - JRT - 2009.04.09 
		QList<QTreeWidgetItem *> list = _ui->treeWidget->findItems(QString::fromStdString( it->second.getLogin()), Qt::MatchExactly, 1);

		if (list.size() > 0) {
			//There should be only one item
			QTreeWidgetItem * item = list[0];
			if (item->checkState(0) == Qt::Checked) {
//				result.push_back(*it);	//VOXOX - JRT - 2009.04.09 
				result.Add( const_cast<IMAccount&>(it->second) );
			}
		}
	}

	return result;
}