Closed Bug 1747086 Opened 3 years ago Closed 3 years ago

Replace /me special handling with a flag

Categories

(Chat Core :: General, task)

Tracking

(thunderbird_esr91 wontfix)

RESOLVED FIXED
100 Branch
Tracking Status
thunderbird_esr91 --- wontfix

People

(Reporter: clokep, Assigned: clokep)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch WIP (obsolete) — Splinter Review

We do a lot of special handling for messages that start with /me (like prepending it for protocols that have a different way of describing an action message). It is more ideal to just use a flag. This should clean-up some of the logic in the core and make some of the protocols less hacky.

I've attached a work in progress patch for this. The parent changeset is quite old so it has probably bitrotted unfortunately.

Attachment #9256380 - Attachment is patch: true
Comment on attachment 9256380 [details] [diff] [review] WIP Review of attachment 9256380 [details] [diff] [review]: ----------------------------------------------------------------- ::: chat/protocols/xmpp/xmpp-base.jsm @@ +999,5 @@ > flags.error = true; > } else { > flags = { incoming: true, _alias: this.contactDisplayName }; > + // XEP-0245: The /me Command. > + if (aMsg.startsWith("\me ")) { This seems to use the wrong slash.

I think it would also make sense to have the /me commands go through sendMsg so we can unify the OutgoingMessage story. To do so I'd suggest adding a second param to sendMsg that is true if the message that is being sent is an action.

(In reply to Martin Giger [:freaktechnik] from comment #2)

I think it would also make sense to have the /me commands go through sendMsg so we can unify the OutgoingMessage story. To do so I'd suggest adding a second param to sendMsg that is true if the message that is being sent is an action.

I actually ended up doing that in the patch for bug 1747090.

I have a patch for this which builds on bug 1760176.

Assignee: nobody → clokep
Status: NEW → ASSIGNED
Attachment #9256380 - Attachment is obsolete: true

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/db05c48a9ab2
Replace /me special handling with a flag. r=freaktechnik

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch

Bug 1735353 also fixed a couple of issues with this when loading messages from logs.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: