mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-20 13:19:07 -04:00
Merge ab72019d26
into c3640306bd
This commit is contained in:
commit
dd73d1e914
2 changed files with 47 additions and 4 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include "gui/common/FriendListModel.h"
|
#include "gui/common/FriendListModel.h"
|
||||||
#include "gui/gxs/GxsIdDetails.h"
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
#include "gui/gxs/GxsIdTreeWidgetItem.h"
|
#include "gui/gxs/GxsIdTreeWidgetItem.h"
|
||||||
|
#include "gui/chat/ChatUserNotify.h"
|
||||||
#include "retroshare/rsexpr.h"
|
#include "retroshare/rsexpr.h"
|
||||||
#include "retroshare/rsmsgs.h"
|
#include "retroshare/rsmsgs.h"
|
||||||
|
|
||||||
|
@ -998,6 +999,12 @@ QVariant RsFriendListModel::decorationRole(const EntryIndex& entry,int col) cons
|
||||||
{
|
{
|
||||||
QPixmap sslAvatar;
|
QPixmap sslAvatar;
|
||||||
bool foundAvatar = false;
|
bool foundAvatar = false;
|
||||||
|
bool hasPrivateChat = false;
|
||||||
|
|
||||||
|
// get peers with waiting incoming chats
|
||||||
|
std::vector<RsPeerId> privateChatIds;
|
||||||
|
ChatUserNotify::getPeersWithWaitingChat(privateChatIds);
|
||||||
|
|
||||||
const HierarchicalProfileInformation *hn = getProfileInfo(entry);
|
const HierarchicalProfileInformation *hn = getProfileInfo(entry);
|
||||||
uint32_t status = RS_STATUS_OFFLINE;
|
uint32_t status = RS_STATUS_OFFLINE;
|
||||||
const HierarchicalNodeInformation *bestNodeInformation = NULL;
|
const HierarchicalNodeInformation *bestNodeInformation = NULL;
|
||||||
|
@ -1026,12 +1033,27 @@ QVariant RsFriendListModel::decorationRole(const EntryIndex& entry,int col) cons
|
||||||
sslAvatar = FilesDefs::getPixmapFromQtResourcePath(AVATAR_DEFAULT_IMAGE);
|
sslAvatar = FilesDefs::getPixmapFromQtResourcePath(AVATAR_DEFAULT_IMAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mDisplayStatusIcon) {
|
||||||
|
for(uint32_t i=0;i<hn->child_node_indices.size();++i) {
|
||||||
|
if (std::find(privateChatIds.begin(), privateChatIds.end(), RsPeerId(mLocations[hn->child_node_indices[i]].node_info.id.toStdString())) != privateChatIds.end()) {
|
||||||
|
// private chat is available
|
||||||
|
hasPrivateChat = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mDisplayStatusIcon) {
|
if (mDisplayStatusIcon) {
|
||||||
if (bestNodeInformation) {
|
if (bestNodeInformation) {
|
||||||
|
if (hasPrivateChat) {
|
||||||
|
QPixmap sslOverlayIcon = FilesDefs::getPixmapFromQtResourcePath(":/images/orange-bubble-64.png");
|
||||||
|
return QVariant(QIcon(createAvatar(sslAvatar, sslOverlayIcon)));
|
||||||
|
} else {
|
||||||
QPixmap sslOverlayIcon = FilesDefs::getPixmapFromQtResourcePath(StatusDefs::imageStatus(status));
|
QPixmap sslOverlayIcon = FilesDefs::getPixmapFromQtResourcePath(StatusDefs::imageStatus(status));
|
||||||
return QVariant(QIcon(createAvatar(sslAvatar, sslOverlayIcon)));
|
return QVariant(QIcon(createAvatar(sslAvatar, sslOverlayIcon)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return QVariant(QIcon(sslAvatar));
|
return QVariant(QIcon(sslAvatar));
|
||||||
}
|
}
|
||||||
|
@ -1047,11 +1069,32 @@ QVariant RsFriendListModel::decorationRole(const EntryIndex& entry,int col) cons
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
QPixmap sslAvatar;
|
QPixmap sslAvatar;
|
||||||
|
bool hasPrivateChat = false;
|
||||||
AvatarDefs::getAvatarFromSslId(RsPeerId(hn->node_info.id.toStdString()), sslAvatar);
|
AvatarDefs::getAvatarFromSslId(RsPeerId(hn->node_info.id.toStdString()), sslAvatar);
|
||||||
|
|
||||||
|
// get peers with waiting incoming chats
|
||||||
|
std::vector<RsPeerId> privateChatIds;
|
||||||
|
ChatUserNotify::getPeersWithWaitingChat(privateChatIds);
|
||||||
|
|
||||||
if (mDisplayStatusIcon) {
|
if (mDisplayStatusIcon) {
|
||||||
|
for(uint32_t i=0;i<mLocations.size();++i){
|
||||||
|
if (std::find(privateChatIds.begin(), privateChatIds.end(), RsPeerId(hn->node_info.id.toStdString())) != privateChatIds.end()) {
|
||||||
|
// private chat is available
|
||||||
|
hasPrivateChat = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mDisplayStatusIcon) {
|
||||||
|
if (hasPrivateChat) {
|
||||||
|
QPixmap sslOverlayIcon = FilesDefs::getPixmapFromQtResourcePath(":/images/orange-bubble-64.png");
|
||||||
|
return QVariant(QIcon(createAvatar(sslAvatar, sslOverlayIcon)));
|
||||||
|
} else {
|
||||||
QPixmap sslOverlayIcon = FilesDefs::getPixmapFromQtResourcePath(StatusDefs::imageStatus(statusRole(entry, col).toInt()));
|
QPixmap sslOverlayIcon = FilesDefs::getPixmapFromQtResourcePath(StatusDefs::imageStatus(statusRole(entry, col).toInt()));
|
||||||
return QVariant(QIcon(createAvatar(sslAvatar, sslOverlayIcon)));
|
return QVariant(QIcon(createAvatar(sslAvatar, sslOverlayIcon)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return QVariant(QIcon(sslAvatar));
|
return QVariant(QIcon(sslAvatar));
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 7.8 KiB |
Loading…
Add table
Add a link
Reference in a new issue