diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-02-22 02:56:10 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-02-22 02:59:28 +0200 |
commit | 58fff45d69717a9e78d127505527e541e22d3cff (patch) | |
tree | 4b072c0191a45013b7525779c6d7c5d5d84e06a0 /ui | |
parent | 452b3d9cf9c0cf6112bd932d7437d800c0bc6d66 (diff) |
Add separate messages for invite reject/accept
Diffstat (limited to 'ui')
-rw-r--r-- | ui/messages/parser.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/messages/parser.go b/ui/messages/parser.go index c242f47..e4bbc30 100644 --- a/ui/messages/parser.go +++ b/ui/messages/parser.go @@ -158,7 +158,11 @@ func getMembershipChangeMessage(evt *event.Event, membership, prevMembership mau text.Colorize(len(senderDisplayname)+len(" invited "), len(displayname), widget.GetHashColor(*evt.StateKey)) case "join": sender = "-->" - text = tstring.NewColorTString(fmt.Sprintf("%s joined the room.", displayname), tcell.ColorGreen) + if prevMembership == mautrix.MembershipInvite { + text = tstring.NewColorTString(fmt.Sprintf("%s accepted the invite.", displayname), tcell.ColorGreen) + } else { + text = tstring.NewColorTString(fmt.Sprintf("%s joined the room.", displayname), tcell.ColorGreen) + } text.Colorize(0, len(displayname), widget.GetHashColor(*evt.StateKey)) case "leave": sender = "<--" @@ -175,7 +179,11 @@ func getMembershipChangeMessage(evt *event.Event, membership, prevMembership mau if displayname == *evt.StateKey { displayname = prevDisplayname } - text = tstring.NewColorTString(fmt.Sprintf("%s left the room.", displayname), tcell.ColorRed) + if prevMembership == mautrix.MembershipInvite { + text = tstring.NewColorTString(fmt.Sprintf("%s rejected the invite.", displayname), tcell.ColorRed) + } else { + text = tstring.NewColorTString(fmt.Sprintf("%s left the room.", displayname), tcell.ColorRed) + } text.Colorize(0, len(displayname), widget.GetHashColor(*evt.StateKey)) } case "ban": |