{"action":"created","comment":{"url":"https://api.github.com/repos/leancloud/docs/pulls/comments/103630537","pull_request_review_id":24421197,"id":103630537,"diff_hunk":"@@ -1397,6 +1397,65 @@ NSDate *yesterday = [today dateByAddingTimeInterval: -86400.0];\n ```\n {% endblock %}\n \n+{% block conversation_query_all_include_system %}\n+```objc\n+- (void)tomQueryAllConversationsIncludeSystem {\n+    // Tom 创建了一个 client，用自己的名字作为 clientId\n+    self.client = [[AVIMClient alloc] initWithClientId:@\"Tom\"];\n+\n+    // Tom 打开 client\n+    [self.client openWithCallback:^(BOOL succeeded, NSError *error) {\n+        // 查询 Tom 参与过的对话，即 m = Tom\n+        AVIMConversationQuery *query1 = [[AVIMClient defaultClient] conversationQuery];\n+        [query1 whereKey:@\"m\" equalTo:@\"Tom\"];\n+\n+        // 查询系统对话，即 sys = true\n+        AVIMConversationQuery *query2 = [[AVIMClient defaultClient] conversationQuery];\n+        [query2 whereKey:@\"sys\" equalTo:@(YES)];\n+\n+        // 将以上两个查询组合成一个查询\n+        AVIMConversationQuery *query = [AVIMConversationQuery orQueryWithSubqueries:@[ query1, query2 ]];\n+\n+        // 执行查询\n+        [query findConversationsWithCallback:^(NSArray *objects, NSError *error) {\n+            NSLog(@\"找到 %ld 个对话！\", [objects count]);\n+        }];\n+    }];\n+}\n+```\n+{% endblock %}\n+\n+{% block conversation_query_active_between %}","path":"views/realtime_guide-objc.md","position":32,"original_position":32,"commit_id":"2294ead17383cbeee951e9c0d03a082b06824c32","original_commit_id":"2294ead17383cbeee951e9c0d03a082b06824c32","user":{"login":"daweibayu","id":2443922,"avatar_url":"https://avatars0.githubusercontent.com/u/2443922?v=3","gravatar_id":"","url":"https://api.github.com/users/daweibayu","html_url":"https://github.com/daweibayu","followers_url":"https://api.github.com/users/daweibayu/followers","following_url":"https://api.github.com/users/daweibayu/following{/other_user}","gists_url":"https://api.github.com/users/daweibayu/gists{/gist_id}","starred_url":"https://api.github.com/users/daweibayu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daweibayu/subscriptions","organizations_url":"https://api.github.com/users/daweibayu/orgs","repos_url":"https://api.github.com/users/daweibayu/repos","events_url":"https://api.github.com/users/daweibayu/events{/privacy}","received_events_url":"https://api.github.com/users/daweibayu/received_events","type":"User","site_admin":false},"body":"```\r\nvoid queryActiveConversationsBetween() {\r\n    AVIMClient client = AVIMClient.getInstance(\"Tom\");\r\n    client.open(new AVIMClientCallback() {\r\n      @Override\r\n      public void done(AVIMClient client, AVIMException e) {\r\n        AVIMConversationQuery query = client.getQuery();\r\n        query.whereGreaterThan(\"lm\", getDateWithDateString(\"2017-01-01\"));\r\n        query.whereLessThan(\"lm\", getDateWithDateString(\"2017-02-01\"));\r\n        query.findInBackground(new AVIMConversationQueryCallback() {\r\n          @Override\r\n          public void done(List<AVIMConversation> conversations, AVIMException e) {\r\n            // conversations 返回的即是在 2017-01-01 至 2017-02-01 之间活跃的 conversation\r\n          }\r\n        });\r\n      }\r\n    });\r\n  }\r\n\r\n  Date getDateWithDateString(String dateString) {\r\n    SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n    Date date = dateFormat.parse(dateString);\r\n    return date;\r\n  }\r\n```\r\n\r\nAndroid 这边并没有类似 or 的 and 操作，而是直接把条件放到了 AVIMConversationQuery 上。","created_at":"2017-03-01T08:19:43Z","updated_at":"2017-03-01T08:19:43Z","html_url":"https://github.com/leancloud/docs/pull/1880#discussion_r103630537","pull_request_url":"https://api.github.com/repos/leancloud/docs/pulls/1880","_links":{"self":{"href":"https://api.github.com/repos/leancloud/docs/pulls/comments/103630537"},"html":{"href":"https://github.com/leancloud/docs/pull/1880#discussion_r103630537"},"pull_request":{"href":"https://api.github.com/repos/leancloud/docs/pulls/1880"}}},"pull_request":{"url":"https://api.github.com/repos/leancloud/docs/pulls/1880","id":107348841,"html_url":"https://github.com/leancloud/docs/pull/1880","diff_url":"https://github.com/leancloud/docs/pull/1880.diff","patch_url":"https://github.com/leancloud/docs/pull/1880.patch","issue_url":"https://api.github.com/repos/leancloud/docs/issues/1880","number":1880,"state":"open","locked":false,"title":"Add example for querying all conversations include system","user":{"login":"tang3w","id":2226563,"avatar_url":"https://avatars3.githubusercontent.com/u/2226563?v=3","gravatar_id":"","url":"https://api.github.com/users/tang3w","html_url":"https://github.com/tang3w","followers_url":"https://api.github.com/users/tang3w/followers","following_url":"https://api.github.com/users/tang3w/following{/other_user}","gists_url":"https://api.github.com/users/tang3w/gists{/gist_id}","starred_url":"https://api.github.com/users/tang3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tang3w/subscriptions","organizations_url":"https://api.github.com/users/tang3w/orgs","repos_url":"https://api.github.com/users/tang3w/repos","events_url":"https://api.github.com/users/tang3w/events{/privacy}","received_events_url":"https://api.github.com/users/tang3w/received_events","type":"User","site_admin":false},"body":"新增示例以查询自己参与过的所有对话，包括系统对话。取代 PR #1740 。\r\n\r\n之前有用户对 ConversationQuery 默认不返回系统对话有疑惑，因此在文档中描述一下。请其他 SDK 也补充一下示例代码。在各自的实时通信文档中新建名为 conversation_query_all_include_system 的 block 即可。\r\n\r\n@leeyeh @daweibayu @leancloud/sdker ","created_at":"2017-02-22T07:21:24Z","updated_at":"2017-03-01T08:19:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3939cc4980b3c3e8dbc29e5ff33c4d858fd05006","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/leancloud/docs/pulls/1880/commits","review_comments_url":"https://api.github.com/repos/leancloud/docs/pulls/1880/comments","review_comment_url":"https://api.github.com/repos/leancloud/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leancloud/docs/issues/1880/comments","statuses_url":"https://api.github.com/repos/leancloud/docs/statuses/2294ead17383cbeee951e9c0d03a082b06824c32","head":{"label":"tang3w:im/query_all_convs_include_system_convs","ref":"im/query_all_convs_include_system_convs","sha":"2294ead17383cbeee951e9c0d03a082b06824c32","user":{"login":"tang3w","id":2226563,"avatar_url":"https://avatars3.githubusercontent.com/u/2226563?v=3","gravatar_id":"","url":"https://api.github.com/users/tang3w","html_url":"https://github.com/tang3w","followers_url":"https://api.github.com/users/tang3w/followers","following_url":"https://api.github.com/users/tang3w/following{/other_user}","gists_url":"https://api.github.com/users/tang3w/gists{/gist_id}","starred_url":"https://api.github.com/users/tang3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tang3w/subscriptions","organizations_url":"https://api.github.com/users/tang3w/orgs","repos_url":"https://api.github.com/users/tang3w/repos","events_url":"https://api.github.com/users/tang3w/events{/privacy}","received_events_url":"https://api.github.com/users/tang3w/received_events","type":"User","site_admin":false},"repo":{"id":33900038,"name":"docs","full_name":"tang3w/docs","owner":{"login":"tang3w","id":2226563,"avatar_url":"https://avatars3.githubusercontent.com/u/2226563?v=3","gravatar_id":"","url":"https://api.github.com/users/tang3w","html_url":"https://github.com/tang3w","followers_url":"https://api.github.com/users/tang3w/followers","following_url":"https://api.github.com/users/tang3w/following{/other_user}","gists_url":"https://api.github.com/users/tang3w/gists{/gist_id}","starred_url":"https://api.github.com/users/tang3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tang3w/subscriptions","organizations_url":"https://api.github.com/users/tang3w/orgs","repos_url":"https://api.github.com/users/tang3w/repos","events_url":"https://api.github.com/users/tang3w/events{/privacy}","received_events_url":"https://api.github.com/users/tang3w/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tang3w/docs","description":"LeanCloud Documentation","fork":true,"url":"https://api.github.com/repos/tang3w/docs","forks_url":"https://api.github.com/repos/tang3w/docs/forks","keys_url":"https://api.github.com/repos/tang3w/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tang3w/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tang3w/docs/teams","hooks_url":"https://api.github.com/repos/tang3w/docs/hooks","issue_events_url":"https://api.github.com/repos/tang3w/docs/issues/events{/number}","events_url":"https://api.github.com/repos/tang3w/docs/events","assignees_url":"https://api.github.com/repos/tang3w/docs/assignees{/user}","branches_url":"https://api.github.com/repos/tang3w/docs/branches{/branch}","tags_url":"https://api.github.com/repos/tang3w/docs/tags","blobs_url":"https://api.github.com/repos/tang3w/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tang3w/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tang3w/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/tang3w/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tang3w/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/tang3w/docs/languages","stargazers_url":"https://api.github.com/repos/tang3w/docs/stargazers","contributors_url":"https://api.github.com/repos/tang3w/docs/contributors","subscribers_url":"https://api.github.com/repos/tang3w/docs/subscribers","subscription_url":"https://api.github.com/repos/tang3w/docs/subscription","commits_url":"https://api.github.com/repos/tang3w/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/tang3w/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/tang3w/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/tang3w/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/tang3w/docs/contents/{+path}","compare_url":"https://api.github.com/repos/tang3w/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tang3w/docs/merges","archive_url":"https://api.github.com/repos/tang3w/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tang3w/docs/downloads","issues_url":"https://api.github.com/repos/tang3w/docs/issues{/number}","pulls_url":"https://api.github.com/repos/tang3w/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/tang3w/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/tang3w/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tang3w/docs/labels{/name}","releases_url":"https://api.github.com/repos/tang3w/docs/releases{/id}","deployments_url":"https://api.github.com/repos/tang3w/docs/deployments","created_at":"2015-04-13T23:41:37Z","updated_at":"2015-05-05T08:04:46Z","pushed_at":"2017-02-22T08:21:42Z","git_url":"git://github.com/tang3w/docs.git","ssh_url":"git@github.com:tang3w/docs.git","clone_url":"https://github.com/tang3w/docs.git","svn_url":"https://github.com/tang3w/docs","homepage":"http://leancloud.cn/docs/","size":44664,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"leancloud:master","ref":"master","sha":"3bae5a534adfb6d0b416da0ad0bbb5249762413c","user":{"login":"leancloud","id":6660518,"avatar_url":"https://avatars1.githubusercontent.com/u/6660518?v=3","gravatar_id":"","url":"https://api.github.com/users/leancloud","html_url":"https://github.com/leancloud","followers_url":"https://api.github.com/users/leancloud/followers","following_url":"https://api.github.com/users/leancloud/following{/other_user}","gists_url":"https://api.github.com/users/leancloud/gists{/gist_id}","starred_url":"https://api.github.com/users/leancloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leancloud/subscriptions","organizations_url":"https://api.github.com/users/leancloud/orgs","repos_url":"https://api.github.com/users/leancloud/repos","events_url":"https://api.github.com/users/leancloud/events{/privacy}","received_events_url":"https://api.github.com/users/leancloud/received_events","type":"Organization","site_admin":false},"repo":{"id":25067518,"name":"docs","full_name":"leancloud/docs","owner":{"login":"leancloud","id":6660518,"avatar_url":"https://avatars1.githubusercontent.com/u/6660518?v=3","gravatar_id":"","url":"https://api.github.com/users/leancloud","html_url":"https://github.com/leancloud","followers_url":"https://api.github.com/users/leancloud/followers","following_url":"https://api.github.com/users/leancloud/following{/other_user}","gists_url":"https://api.github.com/users/leancloud/gists{/gist_id}","starred_url":"https://api.github.com/users/leancloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leancloud/subscriptions","organizations_url":"https://api.github.com/users/leancloud/orgs","repos_url":"https://api.github.com/users/leancloud/repos","events_url":"https://api.github.com/users/leancloud/events{/privacy}","received_events_url":"https://api.github.com/users/leancloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/leancloud/docs","description":"LeanCloud Documentation","fork":false,"url":"https://api.github.com/repos/leancloud/docs","forks_url":"https://api.github.com/repos/leancloud/docs/forks","keys_url":"https://api.github.com/repos/leancloud/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leancloud/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leancloud/docs/teams","hooks_url":"https://api.github.com/repos/leancloud/docs/hooks","issue_events_url":"https://api.github.com/repos/leancloud/docs/issues/events{/number}","events_url":"https://api.github.com/repos/leancloud/docs/events","assignees_url":"https://api.github.com/repos/leancloud/docs/assignees{/user}","branches_url":"https://api.github.com/repos/leancloud/docs/branches{/branch}","tags_url":"https://api.github.com/repos/leancloud/docs/tags","blobs_url":"https://api.github.com/repos/leancloud/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leancloud/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leancloud/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/leancloud/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leancloud/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/leancloud/docs/languages","stargazers_url":"https://api.github.com/repos/leancloud/docs/stargazers","contributors_url":"https://api.github.com/repos/leancloud/docs/contributors","subscribers_url":"https://api.github.com/repos/leancloud/docs/subscribers","subscription_url":"https://api.github.com/repos/leancloud/docs/subscription","commits_url":"https://api.github.com/repos/leancloud/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/leancloud/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/leancloud/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/leancloud/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/leancloud/docs/contents/{+path}","compare_url":"https://api.github.com/repos/leancloud/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leancloud/docs/merges","archive_url":"https://api.github.com/repos/leancloud/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leancloud/docs/downloads","issues_url":"https://api.github.com/repos/leancloud/docs/issues{/number}","pulls_url":"https://api.github.com/repos/leancloud/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/leancloud/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/leancloud/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leancloud/docs/labels{/name}","releases_url":"https://api.github.com/repos/leancloud/docs/releases{/id}","deployments_url":"https://api.github.com/repos/leancloud/docs/deployments","created_at":"2014-10-11T07:14:37Z","updated_at":"2017-02-23T10:10:57Z","pushed_at":"2017-03-01T07:52:08Z","git_url":"git://github.com/leancloud/docs.git","ssh_url":"git@github.com:leancloud/docs.git","clone_url":"https://github.com/leancloud/docs.git","svn_url":"https://github.com/leancloud/docs","homepage":"https://leancloud.cn/docs/","size":43031,"stargazers_count":377,"watchers_count":377,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":210,"mirror_url":null,"open_issues_count":69,"forks":210,"open_issues":69,"watchers":377,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leancloud/docs/pulls/1880"},"html":{"href":"https://github.com/leancloud/docs/pull/1880"},"issue":{"href":"https://api.github.com/repos/leancloud/docs/issues/1880"},"comments":{"href":"https://api.github.com/repos/leancloud/docs/issues/1880/comments"},"review_comments":{"href":"https://api.github.com/repos/leancloud/docs/pulls/1880/comments"},"review_comment":{"href":"https://api.github.com/repos/leancloud/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leancloud/docs/pulls/1880/commits"},"statuses":{"href":"https://api.github.com/repos/leancloud/docs/statuses/2294ead17383cbeee951e9c0d03a082b06824c32"}}}}
{"actor":{"display_login":"daweibayu"}}