Skip to content

Commit fd3bd80

Browse files
committed
[release] 2.4.0
1 parent 89456cd commit fd3bd80

File tree

7 files changed

+32
-6
lines changed

7 files changed

+32
-6
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "leancloud-realtime",
3-
"version": "2.3.5",
3+
"version": "2.4.0",
44
"homepage": "http://github.com/leancloud/js-realtime-sdk/",
55
"authors": [
66
"WangXiao <[email protected]>"

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.4.0
2+
### Features
3+
* query 方法新增参数 `compact`, `withLastMessages`
4+
15
## 2.3.5
26
### Bug Fixes
37
* 修复 query 方法自动增加当前用户为条件的 Bug

dist/AV.realtime.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var ajax = tool.ajax;
2323
var extend = tool.extend;
2424

2525
// 当前版本
26-
var VERSION = '2.3.4';
26+
var VERSION = '2.4.0';
2727

2828
// 配置项
2929
var config = {
@@ -504,6 +504,13 @@ var newRealtimeObject = function newRealtimeObject() {
504504
break;
505505
}
506506
options.serialId = engine.getSerialId(cache);
507+
options.flag = 0;
508+
if (options.compact) {
509+
options.flag |= 1;
510+
}
511+
if (options.withLastMessages) {
512+
options.flag |= 2;
513+
}
507514
var fun = function fun(data) {
508515
if (data.i === options.serialId) {
509516
if (callback) {
@@ -947,6 +954,10 @@ engine.convQuery = function (cache, options) {
947954
limit: options.limit || 10,
948955
// skip 可选,数字,默认0
949956
skip: options.skip || 0,
957+
// bitflag
958+
// 0001 - 不返回成员列表
959+
// 0010 - 返回对话最近一条消息
960+
flag: options.flag,
950961
// i serial-id
951962
i: options.serialId
952963
});

dist/AV.realtime.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/realtime.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var ajax = tool.ajax;
1313
var extend = tool.extend;
1414

1515
// 当前版本
16-
var VERSION = '2.3.5';
16+
var VERSION = '2.4.0';
1717

1818
// 配置项
1919
var config = {
@@ -494,6 +494,13 @@ var newRealtimeObject = function newRealtimeObject() {
494494
break;
495495
}
496496
options.serialId = engine.getSerialId(cache);
497+
options.flag = 0;
498+
if (options.compact) {
499+
options.flag |= 1;
500+
}
501+
if (options.withLastMessages) {
502+
options.flag |= 2;
503+
}
497504
var fun = function fun(data) {
498505
if (data.i === options.serialId) {
499506
if (callback) {
@@ -937,6 +944,10 @@ engine.convQuery = function (cache, options) {
937944
limit: options.limit || 10,
938945
// skip 可选,数字,默认0
939946
skip: options.skip || 0,
947+
// bitflag
948+
// 0001 - 不返回成员列表
949+
// 0010 - 返回对话最近一条消息
950+
flag: options.flag,
940951
// i serial-id
941952
i: options.serialId
942953
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "leancloud-realtime",
3-
"version": "2.3.5",
3+
"version": "2.4.0",
44
"description": "LeanCloud Realtime Message JavaScript SDK",
55
"main": "lib/realtime.js",
66
"directories": {

src/realtime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var ajax = tool.ajax;
1313
var extend = tool.extend;
1414

1515
// 当前版本
16-
var VERSION = '2.3.5';
16+
var VERSION = '2.4.0';
1717

1818
// 配置项
1919
var config = {

0 commit comments

Comments
 (0)