openimsdk / open-im-uniapp-demo

IM
https://openim.io
GNU General Public License v3.0
143 stars 103 forks source link

Bug: <describe the error> #51

Closed chen459236681 closed 9 months ago

chen459236681 commented 9 months ago

What happened?

更改昵称后,对话框已发送后的昵称未变,想根据昵称判断角色无法实现

What did you expect to happen?

1

How can we reproduce it (as minimally and precisely as possible)?

1

Anything else we need to know?

1

version

```console $ {name} version # paste output here ```

Cloud provider

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Install tools

chen459236681 commented 9 months ago

image

lgz5689 commented 9 months ago

不要使用昵称去判断 使用userID去判断 userID是唯一的

chen459236681 commented 9 months ago

不要使用昵称去判断 使用userID去判断 userID是唯一的

image 我的需求是在对话框里,只获取对方聊天数据做些处理,然而没有区分是谁的字段,唯一不同的就是name了,但是如果我改了昵称,这边的还没改。不管怎么说也是个BUG。如果有userid最好,但是对话的数据没有us字段返回无法判断

lgz5689 commented 9 months ago

可以通过sendID和recvID 判断消息是哪一方发送的

lgz5689 commented 9 months ago

可以通过sendID和recvID 判断消息是哪一方发送的

SendID === 当前userID 拿就是自己发送的消息 否则就是对方发送的

chen459236681 commented 9 months ago

可以通过sendID和recvID 判断消息是哪一方发送的

SendID === 当前userID 拿就是自己发送的消息 否则就是对方发送的

OK明白,原来SendID 就是 当前userID。解决 ,谢谢