Terrance/SkPy

Get type of message by content

mihalt opened this issue · 1 comments

Are any ways to get type of Message from raw content, like some of this

SkPy/skpy/msg.py

Lines 247 to 262 in f263fab

msgCls = {"Text": SkypeTextMsg,
"RichText": SkypeTextMsg,
"RichText/Contacts": SkypeContactMsg,
"RichText/Location": SkypeLocationMsg,
"RichText/Media_GenericFile": SkypeFileMsg,
"RichText/UriObject": SkypeImageMsg,
"RichText/Media_AudioMsg": SkypeAudioMsg,
"RichText/Media_Video": SkypeVideoMsg,
"RichText/Media_Card": SkypeCardMsg,
"Event/Call": SkypeCallMsg,
"ThreadActivity/TopicUpdate": SkypeTopicPropertyMsg,
"ThreadActivity/JoiningEnabledUpdate": SkypeOpenPropertyMsg,
"ThreadActivity/HistoryDisclosedUpdate": SkypeHistoryPropertyMsg,
"ThreadActivity/AddMember": SkypeAddMemberMsg,
"ThreadActivity/RoleUpdate": SkypeChangeMemberMsg,
"ThreadActivity/DeleteMember": SkypeRemoveMemberMsg}.get(raw.get("messagetype"), cls)

For example, I would like to define what type of conent is in quote.

If you mean inferring the type of a message from its content alone, then no -- Skype provides the type inside each message, so there's no need for SkPy to guess.