Clean up event accesses and tests

This is in preparation to refactor FrozenEvent to support different
event formats for different room versions
This commit is contained in:
Erik Johnston 2018-11-02 13:44:12 +00:00
parent 1b21e771d0
commit b86d05a279
5 changed files with 7 additions and 10 deletions

View file

@ -311,10 +311,10 @@ class HttpPusher(object):
]
}
}
if event.type == 'm.room.member':
if event.type == 'm.room.member' and event.is_state():
d['notification']['membership'] = event.content['membership']
d['notification']['user_is_target'] = event.state_key == self.user_id
if self.hs.config.push_include_content and 'content' in event:
if self.hs.config.push_include_content and event.content:
d['notification']['content'] = event.content
# We no longer send aliases separately, instead, we send the human