From c1286661090731729e76e48d5e47988ad0175a20 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 25 Mar 2018 12:35:50 +0300 Subject: Refactor things and add proper wheel scroll support --- matrix/matrix.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'matrix') diff --git a/matrix/matrix.go b/matrix/matrix.go index 8199449..7ba6ebb 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -260,7 +260,8 @@ func (c *Container) processOwnMembershipChange(evt *gomatrix.Event) { if evt.Unsigned.PrevContent != nil { prevMembership, _ = evt.Unsigned.PrevContent["membership"].(string) } - if membership == prevMembership { + const Hour = 1 * 60 * 60 * 1000 + if membership == prevMembership || evt.Unsigned.Age > Hour { return } switch membership { @@ -273,11 +274,6 @@ func (c *Container) processOwnMembershipChange(evt *gomatrix.Event) { // HandleMembership is the event handler for the m.room.membership state event. func (c *Container) HandleMembership(evt *gomatrix.Event) { - const Hour = 1 * 60 * 60 * 1000 - if evt.Unsigned.Age > Hour { - return - } - if evt.StateKey != nil && *evt.StateKey == c.config.Session.UserID { c.processOwnMembershipChange(evt) } -- cgit v1.2.3