Closed Bug 1347535 Opened 3 years ago Closed 5 months ago

Display nicknames of Participants instead of Ids

Categories

(Chat Core :: Matrix, enhancement)

enhancement
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Instantbird 72

People

(Reporter: matrixisreal, Assigned: clokep)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

only Id's are diplayed now on both Participants list and on the Conversation.

Find a way to identify users by nicks(they are not unique).
Can you give examples of what each of these things are? (Or link to documentation explaining the differences.)
We get Participants info from room-member object. : 
        http://matrix-org.github.io/matrix-js-sdk/0.7.5/module-models_room-member.html

which has fields userId and name.

userId : The user ID of this member. (Note that this is unique for an account)
   Ex: @mozilla_matrixisreal:matrix.org

name: The human-readable name for this room member. (This is similar to IRC nicks)
   Ex: matrixisreal
I have run across some problems while trying to solve this.

Firstly, we are most likely to use Roommember.name in here : 
 https://dxr.mozilla.org/comm-central/source/chat/protocols/matrix/matrix.js#19-20
which is what riot does.

But Some issues:
1. To differentiate participants from IRC, matrix stores names as nick (IRC) , so we should take care to chop off  (IRC) if the participant is from IRC.

[Optional] :
2. We might want to prioritize participants according to some criteria and sort according to it in the list instead of just alphabetical sort?
   - This is what Riot does, not sure what its criteria is.
   - This is very much important in case of channels with a lot of participants.
   - I don't know if prpls give a chance to do this, but I think its important.
Need some ideas on this.
Flags: needinfo?(fred.wang)
Flags: needinfo?(clokep)
(In reply to Pavan Karthik [:matrixisreal] from comment #3)
> I have run across some problems while trying to solve this.
> 
> But Some issues:
> 1. To differentiate participants from IRC, matrix stores names as nick (IRC)
> , so we should take care to chop off  (IRC) if the participant is from IRC.

You mean it stores the nick as "<actual nickname> (IRC)"? What does Riot do here? I think it just displays them, let's start with the simple behavior of just using the exact value there.

> [Optional] :
> 2. We might want to prioritize participants according to some criteria and
> sort according to it in the list instead of just alphabetical sort?
>    - This is what Riot does, not sure what its criteria is.
>    - This is very much important in case of channels with a lot of
> participants.
>    - I don't know if prpls give a chance to do this, but I think its
> important.

This is unrelated to prpls and is a UI decision. Other protocols (e.g. IRC) have the same issue. See bug 953656 where we decided not to do this.
Flags: needinfo?(clokep)
> 
> You mean it stores the nick as "<actual nickname> (IRC)"? What does Riot do
> here? I think it just displays them, let's start with the simple behavior of
> just using the exact value there.
> 

the only difference is during TAB completion, i.e nick (IRC) 's Tab completion is just "nick".

> 
> This is unrelated to prpls and is a UI decision. Other protocols (e.g. IRC)
> have the same issue. See bug 953656 where we decided not to do this.

Cool. :)
(In reply to Pavan Karthik [:matrixisreal] from comment #5)
> > 
> > You mean it stores the nick as "<actual nickname> (IRC)"? What does Riot do
> > here? I think it just displays them, let's start with the simple behavior of
> > just using the exact value there.
> > 
> 
> the only difference is during TAB completion, i.e nick (IRC) 's Tab
> completion is just "nick".

Interesting, I'm not sure that tab completion is customization at all by prpls in Instantbird. My main concern with stripping the " (IRC)" is that this might exist for other bridges too and then it becomes whack-a-mole. So let's leave it for now.
Clearing the needinfo. What I noticed was summarized in comment 2. I initially tried the human-readable "name" but because it's not a unique id, I switched to "userId". I don't remember the details.
Flags: needinfo?(fred.wang)
Blocks: 1572636
Attached patch Patch v1Splinter Review

This builds on the patch in bug 1377952 to support names (and updating of names) for Matrix.

Assignee: nobody → clokep
Status: NEW → ASSIGNED
Attachment #9104258 - Flags: review?(florian)
Comment on attachment 9104258 [details] [diff] [review]
Patch v1

Paul had expressed an interest in taking a look at the Matrix code.
Attachment #9104258 - Flags: review?(paul)
Comment on attachment 9104258 [details] [diff] [review]
Patch v1

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

Looks good.  In the participants list I see some entries that are nicknames rather than ids.
Attachment #9104258 - Flags: review?(paul) → review+
Attachment #9104258 - Flags: review?(florian)

Pushed by clokep@gmail.com:
https://hg.mozilla.org/comm-central/rev/ad8a9f5244f8
Display names of Matrix participants instead of IDs. r=pmorris

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Instantbird 72
You need to log in before you can comment on or make changes to this bug.