blacksailer / depecher

Depecher - Unofficial Sailfish OS client for Telegram based on tdlib
44 stars 32 forks source link

invites #31

Open Thaodan opened 6 years ago

Thaodan commented 6 years ago

Currently invites are just show as unsupported. whats is needed to show them properly?

blacksailer commented 6 years ago

add new static parse function of messageChatJoinParseLink to ParseObject

add to function parseMessageContent newly created function in ParseObject class

Edit data in MessagingModel class to visualize this message type

edit MesaageItem.qml by adding Component to show this message about new user

Thaodan commented 6 years ago

Are we talking about the same thing in mean "Person xxx added by xx"

blacksailer commented 6 years ago

I thought about " xxx joined by invite link"

And yes, it is one type of message in tdlib. I may be mistaken only with type. It can have some other name

Thaodan commented 6 years ago

Is there a representation of the objects inside an json object somewhere?

blacksailer commented 6 years ago

Yes, it is on https://core.telegram.org/tdlib/docs/

Here is an example. Let's try to parse updateNewMessage json received from telegram. In json format it looks like this.

Every json object response from telegram has additional field @type - which keeps a type of received object. According to docs, updateNewMessage has fields contains_mention, disable_notification which are boolean and message field wich is object_ptr. In json format object_ptr is json object. In depecher parsing this message field is look like this.

Also updateNewMessage is used by MessagingModel. It receives signal from TdlibJsonWrapper and add it to message list here

To see how types converted to json, please read a description to td_json_client here

Happy hacking!)

Thaodan commented 6 years ago

So in this case the type only contains its type?

blacksailer commented 6 years ago

In this case @type" - string, "contains_mention" - bool, "disable_notification" - bool, "message" - object.

Thaodan commented 6 years ago

I mean in the case of messageChatJoinParseLink.