Skip to content

Commit

Permalink
Merge pull request #1977 from nextcloud/fix/noid/ooo-for-own-user
Browse files Browse the repository at this point in the history
fix(ooo): Hide "Talk to ..." when same user or active user
  • Loading branch information
Ivansss authored Feb 11, 2025
2 parents 96b0133 + 4221a94 commit 09301bd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions NextcloudTalk/OutOfOfficeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ import SwiftyAttributes

replacement.attributedText = replacementString + separatorString + usernameString

let talkIcon = UIImage(named: "talk-20")?.withRenderingMode(.alwaysTemplate)
menuActions.append(UIAction(title: NSLocalizedString("Talk to", comment: "Talk to a user") + " " + replacementUserDisplayname, image: talkIcon) { [unowned self] _ in
NotificationCenter.default.post(name: .NCChatViewControllerTalkToUserNotification, object: self, userInfo: ["actorId": replacementUserId])
})
if let account = room.account, replacementUserId != account.userId, replacementUserId != absenceData.userId {
let talkIcon = UIImage(named: "talk-20")?.withRenderingMode(.alwaysTemplate)
menuActions.append(UIAction(title: NSLocalizedString("Talk to", comment: "Talk to a user") + " " + replacementUserDisplayname, image: talkIcon) { [unowned self] _ in
NotificationCenter.default.post(name: .NCChatViewControllerTalkToUserNotification, object: self, userInfo: ["actorId": replacementUserId])
})
}
} else {
replacement.isHidden = true
}
Expand Down

0 comments on commit 09301bd

Please sign in to comment.