Make invites mostly work
This commit is contained in:
parent
455d9fc4c5
commit
806f0f1bf0
@ -578,20 +578,22 @@ func (c *Container) processOwnMembershipChange(evt *mautrix.Event) {
|
|||||||
room := c.GetRoom(evt.RoomID)
|
room := c.GetRoom(evt.RoomID)
|
||||||
switch membership {
|
switch membership {
|
||||||
case "join":
|
case "join":
|
||||||
|
room.HasLeft = false
|
||||||
|
fallthrough
|
||||||
|
case "invite":
|
||||||
if c.config.AuthCache.InitialSyncDone {
|
if c.config.AuthCache.InitialSyncDone {
|
||||||
c.ui.MainView().AddRoom(room)
|
c.ui.MainView().AddRoom(room)
|
||||||
}
|
}
|
||||||
room.HasLeft = false
|
|
||||||
case "leave":
|
case "leave":
|
||||||
if c.config.AuthCache.InitialSyncDone {
|
if c.config.AuthCache.InitialSyncDone {
|
||||||
c.ui.MainView().RemoveRoom(room)
|
c.ui.MainView().RemoveRoom(room)
|
||||||
}
|
}
|
||||||
room.HasLeft = true
|
room.HasLeft = true
|
||||||
room.Unload()
|
room.Unload()
|
||||||
case "invite":
|
default:
|
||||||
// TODO handle
|
return
|
||||||
debug.Printf("%s invited the user to %s", evt.Sender, evt.RoomID)
|
|
||||||
}
|
}
|
||||||
|
c.ui.Render()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Container) parseReadReceipt(evt *mautrix.Event) (largestTimestampEvent string) {
|
func (c *Container) parseReadReceipt(evt *mautrix.Event) (largestTimestampEvent string) {
|
||||||
|
@ -119,6 +119,8 @@ func cmdAccept(cmd *Command) {
|
|||||||
} else {
|
} else {
|
||||||
cmd.Reply("Successfully accepted invite")
|
cmd.Reply("Successfully accepted invite")
|
||||||
}
|
}
|
||||||
|
cmd.MainView.UpdateTags(room)
|
||||||
|
go cmd.MainView.LoadHistory(room.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func cmdReject(cmd *Command) {
|
func cmdReject(cmd *Command) {
|
||||||
|
@ -138,7 +138,6 @@ func (list *RoomList) checkTag(tag string) {
|
|||||||
//delete(list.items, tag)
|
//delete(list.items, tag)
|
||||||
ok = false
|
ok = false
|
||||||
}
|
}
|
||||||
debug.Print("Checking", tag, index, trl.IsEmpty(), ok)
|
|
||||||
|
|
||||||
if ok && index == -1 {
|
if ok && index == -1 {
|
||||||
list.tags = append(list.tags, tag)
|
list.tags = append(list.tags, tag)
|
||||||
|
Loading…
Reference in New Issue
Block a user