Comments (6)
from js-realtime-sdk.
感觉没必要通过 room.list 来获取members,多一次请求。
from js-realtime-sdk.
后来考虑一下,可能为了 room(roomId) 的时候,不去请求members,因为members 可能很长,所以单独弄成 list 来找members。看了下源码,发现 room(roomId) 也是请求了 members 的,
this.query({
where: {
objectId: argument
}
}, function(data) {
// 如果服务器端有这个 id
if (data.length) {
convObject.id = argument;
convObject.name = data[0].name;
// 获取初始化时的属性
convObject.attr = data[0].attr;
}
if (callback) {
// 如果服务器端存在就直接返回 roomObject
if (data.length) {
callback(convObject);
}
// 如果服务器端不存在这个 room id
else {
callback(null);
}
}
});
所以这里的设计似乎有点奇怪。
from js-realtime-sdk.
除了 member 其他几个值都是生成这个 room 时初始化的,而 member 是可能不断变化的。所以希望用户每次能够主动获取。
from js-realtime-sdk.
单聊的 members 都是固定的。
而members 还是会频繁去获取。 room.members 的很方便使用。
所以我觉得可以提供 room.members ,也支持 list 来拉取最新的members。
from js-realtime-sdk.
还是统一些比较好。
from js-realtime-sdk.
Related Issues (20)
- 更新 SDK,让美国节点彻底不依赖于注册在国内的域名。 HOT 1
- Typescript导入富媒体消息插件报错 HOT 5
- 处理连接断开后的清理工作时增加状态检查
- IMClient 监听一次‘message’ 回调函数触发三次 HOT 3
- web conversation.read 后 conversation.lastReadAt 不更新,并且 IOS .read 无响应
- CONVERSATION_QUERY_FAILED HOT 7
- 在 queryMessages 时,typescript 报错
- 心跳包 一直报错
- leancloud-realtime-plugin-typed-messages 发下新版? HOT 1
- 对话支持 and 与 or 查询
- 小程序 SDK 引入报错 HOT 2
- Error: App [qQS3pFiLfOx5YGlokrphiKqg-9Nh9j0Va] is aleady initialized. HOT 3
- TypeError: [object Object] is not a Message
- TypeError: [object Object] is not a Message
- 项目运行不了是为什么呢 HOT 3
- PersistentConversation#get 支持深度嵌套的 key HOT 2
- 优化 LiveQuery 订阅失败的处理
- 升级 5.0.0-rc.6 后,项目无法运行 HOT 8
- Warning Using browser-only version of superagent in non-browser environment HOT 10
- 初始化 Realtime 时 plugins 参数可以接受非数组,但类型定义文件中没有包含这种情况
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-realtime-sdk.