mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
fix: fix clear chat and mute/unmute chat for communities
This commit is contained in:
parent
84034d5dbf
commit
e806ef9ff9
@ -347,7 +347,7 @@ QtObject:
|
|||||||
proc messagesCleared*(self: ChatsView) {.signal.}
|
proc messagesCleared*(self: ChatsView) {.signal.}
|
||||||
|
|
||||||
proc clearMessages*(self: ChatsView, id: string) =
|
proc clearMessages*(self: ChatsView, id: string) =
|
||||||
let channel = self.chats.getChannelById(id)
|
let channel = self.getChannelById(id)
|
||||||
if (channel == nil):
|
if (channel == nil):
|
||||||
return
|
return
|
||||||
self.messageList[id].clear(not channel.isNil and channel.chatType != ChatType.Profile)
|
self.messageList[id].clear(not channel.isNil and channel.chatType != ChatType.Profile)
|
||||||
@ -655,15 +655,15 @@ QtObject:
|
|||||||
|
|
||||||
proc muteCurrentChannel*(self: ChatsView) {.slot.} =
|
proc muteCurrentChannel*(self: ChatsView) {.slot.} =
|
||||||
self.activeChannel.mute()
|
self.activeChannel.mute()
|
||||||
let channel = self.chats.getChannelById(self.activeChannel.id())
|
let channel = self.getChannelById(self.activeChannel.id())
|
||||||
channel.muted = true
|
channel.muted = true
|
||||||
self.chats.updateChat(channel)
|
self.updateChannelInRightList(channel)
|
||||||
|
|
||||||
proc unmuteCurrentChannel*(self: ChatsView) {.slot.} =
|
proc unmuteCurrentChannel*(self: ChatsView) {.slot.} =
|
||||||
self.activeChannel.unmute()
|
self.activeChannel.unmute()
|
||||||
let channel = self.chats.getChannelById(self.activeChannel.id())
|
let channel = self.getChannelById(self.activeChannel.id())
|
||||||
channel.muted = false
|
channel.muted = false
|
||||||
self.chats.updateChat(channel)
|
self.updateChannelInRightList(channel)
|
||||||
|
|
||||||
proc muteChannel*(self: ChatsView, channelIndex: int) {.slot.} =
|
proc muteChannel*(self: ChatsView, channelIndex: int) {.slot.} =
|
||||||
if (self.chats.chats.len == 0): return
|
if (self.chats.chats.len == 0): return
|
||||||
@ -674,7 +674,7 @@ QtObject:
|
|||||||
return
|
return
|
||||||
selectedChannel.muted = true
|
selectedChannel.muted = true
|
||||||
self.status.chat.muteChat(selectedChannel)
|
self.status.chat.muteChat(selectedChannel)
|
||||||
self.chats.updateChat(selectedChannel)
|
self.updateChannelInRightList(selectedChannel)
|
||||||
|
|
||||||
proc unmuteChannel*(self: ChatsView, channelIndex: int) {.slot.} =
|
proc unmuteChannel*(self: ChatsView, channelIndex: int) {.slot.} =
|
||||||
if (self.chats.chats.len == 0): return
|
if (self.chats.chats.len == 0): return
|
||||||
@ -685,8 +685,7 @@ QtObject:
|
|||||||
return
|
return
|
||||||
selectedChannel.muted = false
|
selectedChannel.muted = false
|
||||||
self.status.chat.unmuteChat(selectedChannel)
|
self.status.chat.unmuteChat(selectedChannel)
|
||||||
self.chats.updateChat(selectedChannel)
|
self.updateChannelInRightList(selectedChannel)
|
||||||
|
|
||||||
|
|
||||||
proc channelIsMuted*(self: ChatsView, channelIndex: int): bool {.slot.} =
|
proc channelIsMuted*(self: ChatsView, channelIndex: int): bool {.slot.} =
|
||||||
if (self.chats.chats.len == 0): return false
|
if (self.chats.chats.len == 0): return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user