mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 06:28:27 +02:00
Merge branch 'bugfix/hide_online_presence' into 'develop'
Hide online presence See merge request bwmessenger/bundesmessenger/bundesmessenger-ios!24
This commit is contained in:
@@ -316,33 +316,34 @@
|
||||
|
||||
- (void)refreshContactPresence
|
||||
{
|
||||
NSString* presenceText;
|
||||
NSString* matrixId = self.firstMatrixId;
|
||||
|
||||
if (matrixId)
|
||||
{
|
||||
MXUser *user = nil;
|
||||
if (BuildSettings.allowLocalContactPresence) {
|
||||
NSString* presenceText;
|
||||
NSString* matrixId = self.firstMatrixId;
|
||||
|
||||
// Consider here all sessions reported into contact manager
|
||||
NSArray* mxSessions = [MXKContactManager sharedManager].mxSessions;
|
||||
for (MXSession *mxSession in mxSessions)
|
||||
if (matrixId)
|
||||
{
|
||||
user = [mxSession userWithUserId:matrixId];
|
||||
if (user)
|
||||
MXUser *user = nil;
|
||||
|
||||
// Consider here all sessions reported into contact manager
|
||||
NSArray* mxSessions = [MXKContactManager sharedManager].mxSessions;
|
||||
for (MXSession *mxSession in mxSessions)
|
||||
{
|
||||
break;
|
||||
user = [mxSession userWithUserId:matrixId];
|
||||
if (user)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
presenceText = [Tools presenceText:user];
|
||||
}
|
||||
|
||||
presenceText = [Tools presenceText:user];
|
||||
else if (contact.isThirdPartyInvite)
|
||||
{
|
||||
presenceText = [VectorL10n roomParticipantsOffline];
|
||||
}
|
||||
|
||||
self.contactInformationLabel.text = presenceText;
|
||||
}
|
||||
else if (contact.isThirdPartyInvite)
|
||||
{
|
||||
presenceText = [VectorL10n roomParticipantsOffline];
|
||||
}
|
||||
|
||||
self.contactInformationLabel.text = presenceText;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - events
|
||||
|
||||
@@ -221,7 +221,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
[self updateSaveUserInfoButtonStatus];
|
||||
|
||||
// Display user's presence
|
||||
UIColor *presenceColor = [MXKAccount presenceColor:self->_mxAccount.userPresence];
|
||||
UIColor *presenceColor = [MXKAccount presenceColor:MXPresenceOffline];
|
||||
if (presenceColor)
|
||||
{
|
||||
self->userPictureButton.layer.borderWidth = 2;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
previewImage:self.picturePlaceholder
|
||||
mediaManager:mxAccount.mxSession.mediaManager];
|
||||
|
||||
presenceColor = [MXKAccount presenceColor:mxAccount.userPresence];
|
||||
presenceColor = [MXKAccount presenceColor:MXPresenceOffline];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
// existing user ?
|
||||
if (user)
|
||||
{
|
||||
thumbnailBorderColor = [MXKAccount presenceColor:user.presence];
|
||||
thumbnailBorderColor = [MXKAccount presenceColor:MXPresenceOffline];
|
||||
presenceText = [self lastActiveTime];
|
||||
// Keep last seen range to update it
|
||||
lastSeenRange = NSMakeRange(self.userLabel.text.length + 2, presenceText.length);
|
||||
@@ -158,7 +158,7 @@
|
||||
}
|
||||
|
||||
// and the presence text (if any)
|
||||
if (presenceText)
|
||||
if (presenceText && BuildSettings.allowLocalContactPresence)
|
||||
{
|
||||
NSString* extraText = [NSString stringWithFormat:@"(%@)", presenceText];
|
||||
self.userLabel.text = [NSString stringWithFormat:@"%@ %@", self.userLabel.text, extraText];
|
||||
|
||||
Reference in New Issue
Block a user