Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

/invite works in direct message chats which seems to be unintended

Open gazzerh opened this issue 10 years ago • 0 comments

While in a direct chat with someone the creator can /invite someone else. This person then gets a direct chat which hasn't got a name.

A record in the subscription collection then looks like this:

{ "_id" : "EPTiZx32hEbtXMyCD", "open" : true, "alert" : true, "unread" : 1, "ts" : ISODate("2016-03-24T16:43:33.057Z"), "rid" : "djAMjZqyL4S5naCWAjkoqswPHcqxNJpM7n", "name" : null, "t" : "d", "u" : { "_id" : "G8TDmD6xJxuAKjmpf", "u
sername" : "useername" } }

As you can see the name is null which I believe is because of this unique key:

        {
            "v": 1,
            "unique": true,
            "key": {
                "u._id": 1,
                "name": 1,
                "t": 1
            },
            "name": "u._id_1_name_1_t_1",
            "ns": "rocketchat.rocketchat_subscription"
        }

The use of /invite in direct chats seems unintended behaviour and probably needs to either be disabled, or fixed to be fully supported including the creation of additional UI functionality like allowing multiple users to be selected in the direct message creation dialog and also the adding of people in the right hand menu.

gazzerh avatar Mar 24 '16 18:03 gazzerh