42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
295 stars 60 forks source link

/me should translate / map to Mattermost's /me do action #281

Closed hloeung closed 4 years ago

hloeung commented 4 years ago

Hi,

/me on IRC currently shows up as italics. Instead, it should map to Mattermost's /me "do action".

guilhermepiccoli commented 4 years ago

@hloeung , I'd say the opposite is equally important. People using /me in mattermost shows me as msg. So, for example, if a colleague called johndoe uses:

/me lunches

I see:

johndoe: lunches

on matterircd! I'd rather see : "johndoe: johndoe lunches" as usually IRC shows the /me command. I've checked debug logs on matterircd and we have a "type: me" in the post event, so it's a matter of having matterircd editing the message when showing in IRC.

42wim commented 4 years ago

Fixed in master.

Now a /me from mattermost shows a correct /me on irc. The /me on irc can not do a mattermost /me action as this option is not exposed through the mattermost api. So on mattermost it'll still show in italic

guilhermepiccoli commented 4 years ago

Thansk @42wim, the IRc is working fine on master of today!

I've noticed the following pattern on mattermost's /me :

[0430] DEBUG matterclient: WsReceiver event: model.WebSocketEvent{Event:"posted", Data:map[string]interface {}{"channel_display_name":"guipy-test", "channel_name":"guipy-test", "channel_type":"P", "post":"{\"id\":\"mtbffnx41b8w3jzeh4ha3d63ze\",\"create_at\":1594005921423,\"update_at\":1594005921423,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"shmnsydaefbx5yxmd8wgut49nr\",\"channel_id\":\"qfxcu5yq1bgx3ytbgp73jb7w8e\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"DREAM\",\"type\":\"\",\"props\":{},\"hashtags\":\"\",\"pending_post_id\":\"shmnsydaefbx5yxmd8wgut49nr:1594005921282\",\"metadata\":{}}", "sender_name":"guipy", "team_id":"84iofptumbfrzmge66jca419zh"}, Broadcast:(model.WebsocketBroadcast)(0xc00006e100), Sequence:34, precomputedJSON:(model.precomputedWebSocketEventJSON)(nil)} [0428] DEBUG matterclient: WsReceiver event: model.WebSocketEvent{Event:"posted", Data:map[string]interface {}{"channel_display_name":"guipy-test", "channel_name":"guipy-test", "channel_type":"P", "post":"{\"id\":\"7s6e6ieoxjrpxpsbheoto9jr1e\",\"create_at\":1594005919130,\"update_at\":1594005919130,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"shmnsydaefbx5yxmd8wgut49nr\",\"channel_id\":\"qfxcu5yq1bgx3ytbgp73jb7w8e\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"SLEEP\",\"type\":\"\",\"props\":{\"override_icon_url\":\"\"},\"hashtags\":\"\",\"pending_post_id\":\"\",\"metadata\":{}}", "sender_name":"guipy", "team_id":"84iofptumbfrzmge66jca419zh"}, Broadcast:(model.WebsocketBroadcast)(0xc00006e000), Sequence:31, precomputedJSON:(model.precomputedWebSocketEventJSON)(nil)}

[0428] is a /me coming from mattermost, it has a clear "pending_post_id" and also the prop "override_icon_url" - so, if we mimic that behavior in messages like this, wouldn't it map to mattermost /me action?