Exemplo n.º 1
0
 def _wrap_event(event_):
     """Wrap hangouts_pb2.Event in ConversationEvent subclass."""
     if event_.HasField('chat_message'):
         return conversation_event.ChatMessageEvent(event_)
     elif event_.HasField('conversation_rename'):
         return conversation_event.RenameEvent(event_)
     elif event_.HasField('membership_change'):
         return conversation_event.MembershipChangeEvent(event_)
     elif event_.HasField('hangout_event'):
         return conversation_event.HangoutEvent(event_)
     else:
         return conversation_event.ConversationEvent(event_)
 def _wrap_event(event_):
     """Wrap hangouts_pb2.Event in ConversationEvent subclass."""
     if event_.HasField('chat_message'):
         return conversation_event.ChatMessageEvent(event_)
     elif event_.HasField('conversation_rename'):
         return conversation_event.RenameEvent(event_)
     elif event_.HasField('membership_change'):
         return conversation_event.MembershipChangeEvent(event_)
     elif event_.HasField('hangout_event'):
         return conversation_event.HangoutEvent(event_)
     elif event_.HasField('group_link_sharing_modification'):
         return conversation_event.GroupLinkSharingModificationEvent(event_)
     else:
         return conversation_event.ConversationEvent(event_)