main icon indicating copy to clipboard operation
main copied to clipboard

Emote payload should give the text without the user mention.

Open raf924 opened this issue 3 years ago • 4 comments

The text property of an emote payload should contain only the text inputted by the user. It is up to the client to construct a message from the payload.

raf924 avatar Jan 19 '23 22:01 raf924

This is a good point. The relevant line is here. This kind of a change would require either updating the old legacy client, or doing a check on the receiving clients to see if they are using the new v2 client. Both options kind of suck.

I'll leave this open until we make a change.

marzavec avatar Jan 20 '23 14:01 marzavec

The change in legacy client seems simple no?

	emote: function (args) {
		args.nick = '*';
		pushMessage(args);
	},
       	emote: function (args) {
		args.nick = '*';
                args.text = `@${args.nick} ${args.text}`;
		pushMessage(args);
	},

right?

raf924 avatar Jan 20 '23 21:01 raf924

That would be the gist of it, yes. However, your example results in every message being @* did something 😛

There are still two other ramifications of simply updating the legacy client. Cached users will miss the name until their cache renews. Legacy bots may fail to parse the names correctly unless updated.

marzavec avatar Jan 20 '23 22:01 marzavec

That would be the gist of it, yes. However, your example results in every message being @* did something 😛

Whoops well it's late

There are still two other ramifications of simply updating the legacy client. Cached users will miss the name until their cache renews. Legacy bots may fail to parse the names correctly unless updated.

Do legacy bots even parse emote? I'm only parsing it because I'm making a bridge rather than a bot. And if they have to update they'll update. And they'll be glad they don't have to do some string sorcery to get the actual emote.

For cached users well when they see that it doesn't work as it should they'll reset their cache.

raf924 avatar Jan 21 '23 00:01 raf924