You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NextcloudTalk/Chat/BaseChatViewController.swift
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2886,6 +2886,11 @@ import SwiftUI
2886
2886
// MARK: - Reactions
2887
2887
2888
2888
func addReaction(reaction:String, to message:NCChatMessage){
2889
+
if !self.room.canReact {
2890
+
NotificationPresenter.shared().present(text:NSLocalizedString("You are not allowed to add or remove reactions in this conversation", comment:""), dismissAfterDelay:5.0, includedStyle:.error)
2891
+
return
2892
+
}
2893
+
2889
2894
if message.reactionsArray().contains(where:{ $0.reaction == reaction && $0.userReacted }){
2890
2895
// We can't add reaction twice
2891
2896
return
@@ -2908,6 +2913,11 @@ import SwiftUI
2908
2913
}
2909
2914
2910
2915
func removeReaction(reaction:String, from message:NCChatMessage){
2916
+
if !self.room.canReact {
2917
+
NotificationPresenter.shared().present(text:NSLocalizedString("You are not allowed to add or remove reactions in this conversation", comment:""), dismissAfterDelay:5.0, includedStyle:.error)
actions.append(UIAction(title:NSLocalizedString("Resend", comment:""), image:.init(systemName:"arrow.clockwise")){ _ in
2511
2508
self.didPressResend(for: message)
2512
2509
})
@@ -2577,14 +2574,14 @@ import SwiftUI
2577
2574
vardestructiveMenuActions:[UIMenuElement]=[]
2578
2575
2579
2576
// Edit option
2580
-
if message.isEditable(for:self.account, in:self.room) && hasChatPermissions{
2577
+
if message.isEditable(for:self.account, in:self.room) && self.room.canChat{
2581
2578
destructiveMenuActions.append(UIAction(title:NSLocalizedString("Edit", comment:"Edit a message or room participants"), image:.init(systemName:"pencil")){ _ in
2582
2579
self.didPressEdit(for: message)
2583
2580
})
2584
2581
}
2585
2582
2586
2583
// Delete option
2587
-
if message.sendingFailed || message.isOfflineMessage || (message.isDeletable(for:self.account, in:self.room) && hasChatPermissions){
2584
+
if message.sendingFailed || message.isOfflineMessage || (message.isDeletable(for:self.account, in:self.room) && self.room.canChat){
2588
2585
destructiveMenuActions.append(UIAction(title:NSLocalizedString("Delete", comment:""), image:.init(systemName:"trash"), attributes:.destructive){ _ in
0 commit comments