diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-03-25 12:35:50 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-03-25 12:35:50 +0300 |
commit | c1286661090731729e76e48d5e47988ad0175a20 (patch) | |
tree | e43ce30f3d3020ec1e2bec13ea7fc954b89e78d4 /matrix | |
parent | e414e20215db3a80bb1cf511390406324e742ebf (diff) |
Refactor things and add proper wheel scroll support
Diffstat (limited to 'matrix')
-rw-r--r-- | matrix/matrix.go | 8 |
1 files changed, 2 insertions, 6 deletions
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) } |