summaryrefslogtreecommitdiff
path: root/client/channel_window.go
diff options
context:
space:
mode:
authorraven <citrons@mondecitronne.com>2025-10-22 15:48:40 -0500
committerraven <citrons@mondecitronne.com>2025-10-22 16:23:32 -0500
commit4b54a1d11fd0fa355b244637612a3fd0af18c60c (patch)
tree43a2d2d1feff2caf40a2e33b6ac4d61185708ab3 /client/channel_window.go
parent9126f2329aa21645e0d5622b0eeed402273efa95 (diff)
events generated from other clients on the same account
Diffstat (limited to 'client/channel_window.go')
-rw-r--r--client/channel_window.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/client/channel_window.go b/client/channel_window.go
index cb6aff2..50b7165 100644
--- a/client/channel_window.go
+++ b/client/channel_window.go
@@ -57,6 +57,11 @@ func (cw *channelWindow) getChannel() *proto.Object {
return globalApp.cache.Get(cw.location.id)
}
+func (cw *channelWindow) isDirect() bool {
+ ch := cw.getChannel()
+ return ch != nil && ch.Kind == "direct-channel"
+}
+
func (cw *channelWindow) watchUser(uid string) {
if !cw.watchedUsers[uid] {
globalApp.cache.Watch(uid)
@@ -147,6 +152,12 @@ func (cw *channelWindow) replyTo(id string) {
func (cw *channelWindow) leaveChannel() {
globalApp.Request(proto.NewCmd("leave", cw.location.id), nil)
+ if !cw.isDirect() {
+ cw.onLeaveChannel()
+ }
+}
+
+func (cw *channelWindow) onLeaveChannel() {
globalApp.windowCache.Evict(cw.location)
globalApp.removeFromHistory(cw.location)
globalApp.channelList.remove(cw.location)