RocketChat / RocketChat/Rocket.Chat
/api/v1/im.list does not return realname and avatar of other direct user
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
I want to show list direct message from logging user to other user. For each other user, list item must display name, avatar and last message content
/api/v1/im.list does not return realname and avatar of other user
Server Setup Information:
Version of Rocket.Chat Server: 0.74.2
Operating System: Linux
Deployment Method(snap/docker/tar/etc): docker
Number of Running Instances: 1
DB Replicaset Oplog: Disabled
Node Version: v8.11.3
mongoDB Version:
Steps to Reproduce:
Call like https://rocket.chat/docs/developer-guides/rest-api/im/list
Expected behavior:
{
"ims": [
{
"other_user": {
"realname": "Toàn 123123",
"avatarUrl": "https://rocket.chat/images/index/devices.png"
},
"_id": "7j8t74jyWQf4ijCWuocHxDiG3B9omYwdkG",
"usernames": [
"admin",
"39"
],
"_updatedAt": "2019-03-21T08:17:54.784Z",
"t": "d",
"msgs": 25,
"ts": "2019-02-27T06:31:41.434Z",
"usersCount": 2,
"lm": "2019-03-21T08:17:54.749Z",
"lastMessage": {
"_id": "WjVuFhjbWxJKrbwye",
"rid": "7j8t74jyWQf4ijCWuocHxDiG3B9omYwdkG",
"msg": "sd",
"ts": "2019-03-21T08:17:54.749Z",
"u": {
"_id": "7j8t74jyWQf4ijCWu",
"username": "39",
"name": "Toàn 123123"
},
"unread": true,
"mentions": [],
"channels": [],
"_updatedAt": "2019-03-21T08:17:54.765Z",
"sandstormSessionId": null
}
}
],
"offset": 0,
"count": 1,
"total": 1,
"success": true
}
Actual behavior:
{
"ims": [
{
"_id": "7j8t74jyWQf4ijCWuocHxDiG3B9omYwdkG",
"usernames": [
"admin",
"39"
],
"_updatedAt": "2019-03-21T08:17:54.784Z",
"t": "d",
"msgs": 25,
"ts": "2019-02-27T06:31:41.434Z",
"usersCount": 2,
"lm": "2019-03-21T08:17:54.749Z",
"lastMessage": {
"_id": "WjVuFhjbWxJKrbwye",
"rid": "7j8t74jyWQf4ijCWuocHxDiG3B9omYwdkG",
"msg": "sd",
"ts": "2019-03-21T08:17:54.749Z",
"u": {
"_id": "7j8t74jyWQf4ijCWu",
"username": "39",
"name": "Toàn 123123"
},
"unread": true,
"mentions": [],
"channels": [],
"_updatedAt": "2019-03-21T08:17:54.765Z",
"sandstormSessionId": null
}
}
],
"offset": 0,
"count": 1,
"total": 1,
"success": true
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the REST API im.list entry point described at https://rocket.chat/docs/developer-guides/rest-api/im/list and trace how its response is assembled. Compare the actual response with the expected payload, then add coverage for the other user's realname and avatarUrl; done means the endpoint returns those fields for direct messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100