From 806f0f1bf0fedcbeb526b11ab4f1d0d4c89e23e1 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 22 Feb 2020 01:30:43 +0200 Subject: Make invites mostly work --- matrix/matrix.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'matrix') 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) { -- cgit v1.2.3