mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05:00
Fixed the initial fill of the friends in the contact sidebar in the MessageComposer. Now the correct state image of the friend is shown.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3929 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
719c0ec30d
commit
9715066181
@ -540,6 +540,9 @@ void MessageComposer::insertSendList()
|
||||
std::list<std::string>::iterator peerIt;
|
||||
rsPeers->getFriendList(peers);
|
||||
|
||||
std::list<StatusInfo> statusInfo;
|
||||
rsStatus->getStatusList(statusInfo);
|
||||
|
||||
std::list<std::string> fillPeerIds;
|
||||
|
||||
// start with groups
|
||||
@ -600,7 +603,6 @@ void MessageComposer::insertSendList()
|
||||
// add equal too, its no problem
|
||||
fillPeerIds.push_back(detail.id);
|
||||
|
||||
|
||||
/* make a widget per friend */
|
||||
QTreeWidgetItem *item = new RSTreeWidgetItem(m_compareRole, TYPE_SSL);
|
||||
|
||||
@ -611,8 +613,17 @@ void MessageComposer::insertSendList()
|
||||
|
||||
int state = RS_STATUS_OFFLINE;
|
||||
if (detail.state & RS_PEER_STATE_CONNECTED) {
|
||||
std::list<StatusInfo>::iterator it;
|
||||
for (it = statusInfo.begin(); it != statusInfo.end() ; it++) {
|
||||
if (it->id == detail.id) {
|
||||
state = it->status;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state != RS_STATUS_OFFLINE) {
|
||||
item->setTextColor(COLUMN_CONTACT_NAME, COLOR_CONNECT);
|
||||
state = RS_STATUS_ONLINE;
|
||||
}
|
||||
|
||||
item->setIcon(COLUMN_CONTACT_NAME, QIcon(StatusDefs::imageUser(state)));
|
||||
|
Loading…
Reference in New Issue
Block a user