Ejemplo n.º 1
0
 def checkEventType(event: dict) -> bool:
     structure = {
         'type': 'm.room.canonical_alias',
         'content': {
             'alias': str
         }
     }
     return (checkStructure(event, structure))
Ejemplo n.º 2
0
 def checkEventType(event: dict) -> bool:
     structure = {
         'type': 'n.output.error',
         'content': {
             'command': str,
             'message': str
         }
     }
     return (checkStructure(event, structure))
Ejemplo n.º 3
0
 def checkEventType(event: dict) -> bool:
     structure = {
         'type': 'm.room.join_rules',
         'content': {
             'join_rule': str
         }
     }
     return (checkStructure(event, structure)
             and event['content']['join_rule'] in JoinRules.joinTypes)
Ejemplo n.º 4
0
 def checkEventType(event: dict) -> bool:
     structure = {
         'type': 'm.room.message',
         'content': {
             'body': str,
             'msgtype': str
         }
     }
     return (checkStructure(event, structure))
Ejemplo n.º 5
0
 def checkEventType(event: dict) -> bool:
     structure = {'type': 'm.room.topic', 'content': {'topic': str}}
     return (checkStructure(event, structure))
Ejemplo n.º 6
0
 def checkEventType(event: dict) -> bool:
     structure = {'unsigned': {'redacted_because': {'event_id': str}}}
     return (checkStructure(event, structure))
Ejemplo n.º 7
0
 def checkEventType(event: dict) -> bool:
     structure = {'type': 'm.room.redaction', 'redacts': str}
     return (checkStructure(event, structure))
Ejemplo n.º 8
0
 def checkEventType(event: dict) -> bool:
     structure = {'type': 'm.room.power_levels'}
     return (checkStructure(event, structure))
Ejemplo n.º 9
0
 def checkEventType(event: dict) -> bool:
     structure = {'prev_content': {'membership': 'join'}}
     return (checkStructure(event, structure))
Ejemplo n.º 10
0
 def checkEventType(event: dict) -> bool:
     structure = {'prev_content': {'membership': 'join'}}
     if event['state_key'] == event['sender']: return (False)
     return (checkStructure(event, structure))
Ejemplo n.º 11
0
 def checkEventType(event: dict) -> bool:
     structure = {'type': 'm.room.member', 'content': {'membership': str}}
     return (checkStructure(event, structure) and
             event['content']['membership'] in RoomMember.membershipTypes)
Ejemplo n.º 12
0
 def checkEventType(event: dict) -> bool:
     structure = {'type': 'm.room.create', 'content': {'creator': str}}
     return (checkStructure(event, structure))
Ejemplo n.º 13
0
 def checkEventType(event: dict) -> bool:
     structure = {'type': 'm.room.aliases', 'content': {'aliases': list}}
     return (checkStructure(event, structure))
Ejemplo n.º 14
0
 def checkEventType(event: dict) -> bool:
     structure = {'state_key': str}
     return (checkStructure(event, structure))
Ejemplo n.º 15
0
 def checkEventType(event: dict) -> bool:
     structure = {'event_id': str, 'sender': str, 'origin_server_ts': int}
     # Note that required field room_id is NOT checked
     # This is because events received through /sync do not include this field
     return (checkStructure(event, structure))
Ejemplo n.º 16
0
 def checkEventType(event: dict) -> bool:
     structure = {'content': {'membership': 'leave'}}
     return (checkStructure(event, structure))
Ejemplo n.º 17
0
 def checkEventType(event: dict) -> bool:
     structure = {'content': {'msgtype': 'm.emote'}}
     return (checkStructure(event, structure))
Ejemplo n.º 18
0
 def checkEventType(event: dict) -> bool:
     structure = {'type': str, 'source': 'Nutmeg', 'content': {}}
     return (checkStructure(event, structure))