aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--matrix/matrix.go10
-rw-r--r--ui/commands.go2
-rw-r--r--ui/room-list.go1
3 files changed, 8 insertions, 5 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index 8819a5b..85c4a46 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -578,20 +578,22 @@ func (c *Container) processOwnMembershipChange(evt *mautrix.Event) {
room := c.GetRoom(evt.RoomID)
switch membership {
case "join":
+ room.HasLeft = false
+ fallthrough
+ case "invite":
if c.config.AuthCache.InitialSyncDone {
c.ui.MainView().AddRoom(room)
}
- room.HasLeft = false
case "leave":
if c.config.AuthCache.InitialSyncDone {
c.ui.MainView().RemoveRoom(room)
}
room.HasLeft = true
room.Unload()
- case "invite":
- // TODO handle
- debug.Printf("%s invited the user to %s", evt.Sender, evt.RoomID)
+ default:
+ return
}
+ c.ui.Render()
}
func (c *Container) parseReadReceipt(evt *mautrix.Event) (largestTimestampEvent string) {
diff --git a/ui/commands.go b/ui/commands.go
index 9b1ac25..0adbb61 100644
--- a/ui/commands.go
+++ b/ui/commands.go
@@ -119,6 +119,8 @@ func cmdAccept(cmd *Command) {
} else {
cmd.Reply("Successfully accepted invite")
}
+ cmd.MainView.UpdateTags(room)
+ go cmd.MainView.LoadHistory(room.ID)
}
func cmdReject(cmd *Command) {
diff --git a/ui/room-list.go b/ui/room-list.go
index 31e4c2a..1e1d1b0 100644
--- a/ui/room-list.go
+++ b/ui/room-list.go
@@ -138,7 +138,6 @@ func (list *RoomList) checkTag(tag string) {
//delete(list.items, tag)
ok = false
}
- debug.Print("Checking", tag, index, trl.IsEmpty(), ok)
if ok && index == -1 {
list.tags = append(list.tags, tag)