mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-31 10:59:23 +00:00
Hide presence if not in contact
This commit is contained in:
parent
e4952ab5c0
commit
38d01ce997
3 changed files with 6 additions and 21 deletions
|
|
@ -420,13 +420,12 @@ int ChatRoomModel::getPresenceStatus() const {
|
|||
auto participants = mChatRoom->getParticipants();
|
||||
auto contact = CoreManager::getInstance()->getContactsListModel()->findContactModelFromSipAddress(Utils::coreStringToAppString((*participants.begin())->getAddress()->asString()));
|
||||
if(contact) {
|
||||
int p = contact->getPresenceLevel();
|
||||
return p;
|
||||
return contact->getPresenceLevel();
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
return -1;
|
||||
}else
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
ParticipantListModel* ChatRoomModel::getParticipants() const{
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ Item {
|
|||
|
||||
PresenceLevel {
|
||||
id: presenceLevelIcon
|
||||
visible: level >= 0
|
||||
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
|
|
|
|||
|
|
@ -52,25 +52,10 @@ Rectangle {
|
|||
//image: _contact && _contact.vcard.avatar
|
||||
image: entry?(entry.contactModel?entry.contactModel.vcard.avatar:entry.avatar?entry.avatar: ''):''
|
||||
|
||||
presenceLevel: entry?(entry.contactModel ? Presence.getPresenceLevel(entry.contactModel.presenceStatus)
|
||||
: Presence.getPresenceLevel(entry.presenceStatus)
|
||||
presenceLevel: entry?(entry.contactModel ? (entry.contactModel.presenceStatus >= 0 ? Presence.getPresenceLevel(entry.contactModel.presenceStatus) : -1)
|
||||
: (entry.presenceStatus >= 0 ? Presence.getPresenceLevel(entry.presenceStatus) : -1)
|
||||
)
|
||||
:-1
|
||||
/*
|
||||
Connections{
|
||||
target: entry.contactModel?entry.contactModel:entry
|
||||
onPresenceStatusChanged:{
|
||||
if(entry){
|
||||
if(entry.contactModel){
|
||||
avatar.presenceLevel = Presence.getPresenceLevel(entry.contactModel.presenceStatus);
|
||||
}else {
|
||||
avatar.presenceLevel = Presence.getPresenceLevel(entry.presenceStatus);
|
||||
}
|
||||
}else {
|
||||
avatar.presenceLevel = -1;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//username: LinphoneUtils.getContactUsername(_contact || entry.sipAddress || entry.fullPeerAddress || entry.peerAddress || '')
|
||||
//username: UtilsCpp.getDisplayName(entry.sipAddress || entry.peerAddress )
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue