Closed Bug 1172355 Opened 9 years ago Closed 9 years ago

Add system messages when someone joins or leaves a room

Categories

(Chat Core :: XMPP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Instantbird 43

People

(Reporter: abdelrahman, Assigned: abdelrahman)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Add system message when someone joins or leaves a room in XMPP.
Bonus points for fixing this bug by fixing bug 954662 ;)
Assignee: nobody → a.ahmed1026
Depends on: 1146093
Blocks: 954959
(In reply to aleth [:aleth] from comment #1)
> Bonus points for fixing this bug by fixing bug 954662 ;)

Let's not do that for now, it's quite complicated and shouldn't delay this bug.
Attached patch rev 1 - join and leave messages (obsolete) — Splinter Review
Attachment #8646632 - Flags: review?(aleth)
Comment on attachment 8646632 [details] [diff] [review]
rev 1 - join and leave messages

Review of attachment 8646632 [details] [diff] [review]:
-----------------------------------------------------------------

::: chat/protocols/xmpp/xmpp.jsm
@@ +310,5 @@
> +
> +          // The reason is in a status element in this case.
> +          reasonNode = aStanza.getElement(["status"]);
> +        }
> +        let reason = reasonNode ? reasonNode.innerText : "";

nit: put a blank line above this to separate it from the long if block.

@@ +360,5 @@
>                             "chat-buddy-add");
> +      if (this.nick != nick && !this.joining) {
> +        let message = _("conversation.message.join", nick);
> +        this.writeMessage(this.name, message, {system: true});
> +       }

You also need "You have rejoined the room" for when the user /join after /part.
Attachment #8646632 - Flags: review?(aleth) → review-
(In reply to aleth [:aleth] from comment #4)
> nit: put a blank line above this to separate it from the long if block.

I reverted this change as it's can be set in code 332.
Attachment #8646632 - Attachment is obsolete: true
Attachment #8646668 - Flags: review?(aleth)
Comment on attachment 8646668 [details] [diff] [review]
rev 2 - join and leave messages

Review of attachment 8646668 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with the typo fixed.

::: chat/protocols/xmpp/xmpp.jsm
@@ +1032,5 @@
>      let muc = this._mucs.get(jid);
>      if (muc) {
>        if (!muc.left)
>          return muc; // We are already in this conversation.
> +      else if (!muc.chatRoomField) {

typo: chatRoomFields
Attachment #8646668 - Flags: review?(aleth) → review+
url:        https://hg.mozilla.org/comm-central/rev/328503b8eba455c491c38e86a625801ad2ffa889
changeset:  328503b8eba455c491c38e86a625801ad2ffa889
user:       Abdelrhman Ahmed <a.ahmed1026@gmail.com>
date:       Tue Aug 11 17:05:00 2015 +0200
description:
Bug 1172355 - Add system messages when someone joins or leaves an XMPP MUC. r=aleth
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Instantbird 43
Typo fixed on checkin, _rejoined marked private.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: