void ParticipantList::populate( const Contacts& rContacts, IMChatSession& imChatSession ) { Participant participant; IMContact* imContact = NULL; bool bAlreadyInChat = false; for ( Contacts::const_iterator it = rContacts.begin(); it != rContacts.end(); it++ ) { if ( includeInCandidateList( (*it).second, imChatSession, bAlreadyInChat ) ) { Contact c = (*it).second; imContact = c.getPreferredIMContact(); participant.setIMContact ( *imContact ); participant.setDisplayName ( c.getDisplayName() ); participant.setIsAlreadyInChat( bAlreadyInChat ); participant.setPixmap ( determineStatus( c ) ); Add( &participant ); } } }
QString QtHistory::formatName(const std::string& name, bool isWengo) const { // do not display realm whith wengo account SipAddress sipAddress(name); QString formattedName = QString::fromStdString(sipAddress.getSipAddress()); Config & config = ConfigManager::getInstance().getCurrentConfig(); QString wengoSuffix = "@" + QString::fromStdString( config.getWengoRealm() ); if (isWengo) { formattedName.remove(wengoSuffix); } formattedName.remove("sip:"); Contact * contact = _cHistory.getCWengoPhone().getCUserProfileHandler().getUserProfileHandler().getCurrentUserProfile()->getContactList().getContactByNumber(formattedName.toStdString()); //VOXOX CHANGE by Rolando - 2009.10.06 QString displayName;//VOXOX CHANGE by Rolando - 2009.10.06 if(contact)//VOXOX CHANGE by Rolando - 2009.10.06 { QString newName = QString::fromStdString(contact->getDisplayName()) + " (" + formattedName + ")";//VOXOX CHANGE by Rolando - 2009.10.06 formattedName = newName;//VOXOX CHANGE by Rolando - 2009.10.06 } return formattedName; }