pinaraf / Slacken

A lightweight Qt client for Slack
GNU General Public License v3.0
25 stars 5 forks source link

Threads support #10

Open pinaraf opened 6 years ago

pinaraf commented 6 years ago

Threads are needed, sadly. Current quick analysis : a thread is created on a channel, with a thread_ts marking the corresponding 'source' message.

Chaussette in :  "{\"ok\":true,\"reply_to\":8,\"ts\":\"1528057945.000078\",\"text\":\"pour moi qui pige pas l'intérêt du bousin ça va être rigolo\"}"

=>

Chaussette in :  "{\"type\":\"message\",\"channel\":\"D4EPF2N22\",\"user\":\"U23UP0ATZ\",\"text\":\"Le thread, sa vie, son œuvre…\",\"ts\":\"1528058163.000059\",\"source_team\":\"T03DFHCR8\",\"team\":\"T03DFHCR8\",\"thread_ts\":\"1528057945.000078\"}"
Chaussette in :  "{\"type\":\"message\",\"message\":{\"type\":\"message\",\"user\":\"U23UP0ATZ\",\"text\":\"pour moi qui pige pas l'int\\u00e9r\\u00eat du bousin \\u00e7a va \\u00eatre rigolo\",\"thread_ts\":\"1528057945.000078\",\"reply_count\":1,\"replies\":[{\"user\":\"U23UP0ATZ\",\"ts\":\"1528058163.000059\"}],\"unread_count\":1,\"ts\":\"1528057945.000078\"},\"subtype\":\"message_replied\",\"hidden\":true,\"channel\":\"D4EPF2N22\",\"event_ts\":\"1528058163.000067\",\"ts\":\"1528058163.000067\"}"
Chaussette in :  "{\"type\":\"thread_subscribed\",\"subscription\":{\"type\":\"thread\",\"channel\":\"D4EPF2N22\",\"thread_ts\":\"1528057945.000078\",\"date_create\":\"1528058163\",\"active\":true,\"last_read\":\"1528058163.000059\"},\"event_ts\":\"1528058163.000070\"}"

Global implementation : extend SlackMessage to have a std::vector answers. These will be the thread answers. Must be fetched later, on demand (?)

In history : 

{"last_read":"1528058215.000061","replies":[{"ts":"1528058163.000059","user":"U23UP0ATZ"},{"ts":"1528058185.000096","user":"U23UP0ATZ"},{"ts":"1528058215.000061","user":"U23UP0ATZ"}],"reply_count":3,"subscribed":true,"text":"pour moi qui pige pas l'intérêt du bousin ça va être rigolo","thread_ts":"1528057945.000078","ts":"1528057945.000078","type":"message","unread_count":0,"user":"U23UP0ATZ"}

User interface : display the thread inline, like a subtree, with a ± icon to expand/reduce the subtree. Hide by default, highlight when there is some unread content ?

What we don't want : the official slack thread ui.

pinaraf commented 6 years ago

When ticking "also send direct message" : 

Chaussette in :  "{\"type\":\"message\",\"channel\":\"D4EPF2N22\",\"user\":\"U42KNNKTP\",\"text\":\"test en cochant la case à la con\",\"ts\":\"1528059170.000082\",\"source_team\":\"T03DFHCR8\",\"team\":\"T03DFHCR8\",\"thread_ts\":\"1528057945.000078\",\"reply_broadcast\":true}"