GitHub PullRequestReviewCommentEvent at 2014-10-22 09:31:40
Repository: odoo
Actor: xmo-odoo
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/odoo/odoo/pulls/comments/19202616","id":19202616,"diff_hunk":"@@ -1487,70 +1446,69 @@ openerp.mail = function (session) {\n         },\n \n         /**\n-         *create the message object and attached on this thread.\n-         * When the message object is create, this method call insert_message for,\n-         * displaying this message on the DOM.\n+         *create the message objects and attached on this thread.\n          * @param : {object} data from calling RPC to \"message_read\"\n          */\n-        create_message_object: function (data) {\n+        create_message_objects: function (messages) {\n             var self = this;\n-\n-            data.thread_level = self.thread_level || 0;\n-            data.options = _.extend(data.options || {}, self.options);\n-\n-            if (data.type=='expandable') {\n-                var message = new mail.ThreadExpandable(self, data, {'context':{\n-                    'default_model': data.model || self.context.default_model,\n-                    'default_res_id': data.res_id || self.context.default_res_id,\n-                    'default_parent_id': self.id,\n-                }});\n-            } else {\n-                data.record_name= (data.record_name != '' && data.record_name) || (self.parent_message && self.parent_message.record_name);\n-                var message = new mail.ThreadMessage(self, data, {'context':{\n-                    'default_model': data.model,\n-                    'default_res_id': data.res_id,\n-                    'default_parent_id': data.id,\n-                }});\n-            }\n-\n-            // check if the message is already create\n-            for (var i in self.messages) {\n-                if (message.id && self.messages[i] && self.messages[i].id == message.id) {\n-                    self.messages[i].destroy();\n+            var res = [];\n+            _(messages).each(function(data){\n+                data.thread_level = self.thread_level || 0;\n+                data.options = _.extend(data.options || {}, self.options);\n+                if (data.type=='expandable') {\n+                    var message = new mail.ThreadExpandable(self, data, {'context':{\n+                        'default_model': data.model || self.context.default_model,\n+                        'default_res_id': data.res_id || self.context.default_res_id,\n+                        'default_parent_id': self.id,\n+                    }});\n+                } else {\n+                    data.record_name= (data.record_name != '' && data.record_name) || (self.parent_message && self.parent_message.record_name);\n+                    var message = new mail.ThreadMessage(self, data, {'context':{\n+                        'default_model': data.model,\n+                        'default_res_id': data.res_id,\n+                        'default_parent_id': data.id,\n+                    }});\n                 }\n-            }\n-            self.messages.push( message );\n \n-            return message;\n+                // check if the message is already create\n+                for (var i in res) {","path":"addons/mail/static/src/js/mail.js","position":146,"original_position":146,"commit_id":"920bc3ddd8b8dfcd4b1225c726b40c8c6d71f165","original_commit_id":"920bc3ddd8b8dfcd4b1225c726b40c8c6d71f165","user":{"login":"xmo-odoo","id":7571158,"avatar_url":"https://avatars.githubusercontent.com/u/7571158?v=2","gravatar_id":"","url":"https://api.github.com/users/xmo-odoo","html_url":"https://github.com/xmo-odoo","followers_url":"https://api.github.com/users/xmo-odoo/followers","following_url":"https://api.github.com/users/xmo-odoo/following{/other_user}","gists_url":"https://api.github.com/users/xmo-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/xmo-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xmo-odoo/subscriptions","organizations_url":"https://api.github.com/users/xmo-odoo/orgs","repos_url":"https://api.github.com/users/xmo-odoo/repos","events_url":"https://api.github.com/users/xmo-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/xmo-odoo/received_events","type":"User","site_admin":false},"body":"* Never iterate on arrays using for…in\r\n* Try using _.filter + _.invoke?","created_at":"2014-10-22T09:31:40Z","updated_at":"2014-10-22T09:31:40Z","html_url":"https://github.com/odoo/odoo/pull/894#discussion_r19202616","pull_request_url":"https://api.github.com/repos/odoo/odoo/pulls/894","_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments/19202616"},"html":{"href":"https://github.com/odoo/odoo/pull/894#discussion_r19202616"},"pull_request":{"href":"https://api.github.com/repos/odoo/odoo/pulls/894"}}},"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/894","id":17933939,"html_url":"https://github.com/odoo/odoo/pull/894","diff_url":"https://github.com/odoo/odoo/pull/894.diff","patch_url":"https://github.com/odoo/odoo/pull/894.patch","issue_url":"https://api.github.com/repos/odoo/odoo/issues/894","number":894,"state":"open","locked":false,"title":"[IMP] mail: chatter: remove insert_message method, instead of push ea...","user":{"login":"tde-banana-odoo","id":7501424,"avatar_url":"https://avatars.githubusercontent.com/u/7501424?v=2","gravatar_id":"","url":"https://api.github.com/users/tde-banana-odoo","html_url":"https://github.com/tde-banana-odoo","followers_url":"https://api.github.com/users/tde-banana-odoo/followers","following_url":"https://api.github.com/users/tde-banana-odoo/following{/other_user}","gists_url":"https://api.github.com/users/tde-banana-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/tde-banana-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tde-banana-odoo/subscriptions","organizations_url":"https://api.github.com/users/tde-banana-odoo/orgs","repos_url":"https://api.github.com/users/tde-banana-odoo/repos","events_url":"https://api.github.com/users/tde-banana-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/tde-banana-odoo/received_events","type":"User","site_admin":false},"body":"...ch message to DOM using insert_message, create render_thread that will render each of it's message","created_at":"2014-07-03T09:28:21Z","updated_at":"2014-10-22T09:31:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a130debab1d9f79071a5180cb3b89045526ed17","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/odoo/odoo/pulls/894/commits","review_comments_url":"https://api.github.com/repos/odoo/odoo/pulls/894/comments","review_comment_url":"https://api.github.com/repos/odoo/odoo/pulls/comments/{number}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/894/comments","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/920bc3ddd8b8dfcd4b1225c726b40c8c6d71f165","head":{"label":"odoo-dev:master-optimize-chatter-rga","ref":"master-optimize-chatter-rga","sha":"920bc3ddd8b8dfcd4b1225c726b40c8c6d71f165","user":{"login":"odoo-dev","id":7466976,"avatar_url":"https://avatars.githubusercontent.com/u/7466976?v=2","gravatar_id":"","url":"https://api.github.com/users/odoo-dev","html_url":"https://github.com/odoo-dev","followers_url":"https://api.github.com/users/odoo-dev/followers","following_url":"https://api.github.com/users/odoo-dev/following{/other_user}","gists_url":"https://api.github.com/users/odoo-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo-dev/subscriptions","organizations_url":"https://api.github.com/users/odoo-dev/orgs","repos_url":"https://api.github.com/users/odoo-dev/repos","events_url":"https://api.github.com/users/odoo-dev/events{/privacy}","received_events_url":"https://api.github.com/users/odoo-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":19853934,"name":"odoo","full_name":"odoo-dev/odoo","owner":{"login":"odoo-dev","id":7466976,"avatar_url":"https://avatars.githubusercontent.com/u/7466976?v=2","gravatar_id":"","url":"https://api.github.com/users/odoo-dev","html_url":"https://github.com/odoo-dev","followers_url":"https://api.github.com/users/odoo-dev/followers","following_url":"https://api.github.com/users/odoo-dev/following{/other_user}","gists_url":"https://api.github.com/users/odoo-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo-dev/subscriptions","organizations_url":"https://api.github.com/users/odoo-dev/orgs","repos_url":"https://api.github.com/users/odoo-dev/repos","events_url":"https://api.github.com/users/odoo-dev/events{/privacy}","received_events_url":"https://api.github.com/users/odoo-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoo-dev/odoo","description":"RD Dev Repository","fork":true,"url":"https://api.github.com/repos/odoo-dev/odoo","forks_url":"https://api.github.com/repos/odoo-dev/odoo/forks","keys_url":"https://api.github.com/repos/odoo-dev/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoo-dev/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoo-dev/odoo/teams","hooks_url":"https://api.github.com/repos/odoo-dev/odoo/hooks","issue_events_url":"https://api.github.com/repos/odoo-dev/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/odoo-dev/odoo/events","assignees_url":"https://api.github.com/repos/odoo-dev/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/odoo-dev/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/odoo-dev/odoo/tags","blobs_url":"https://api.github.com/repos/odoo-dev/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoo-dev/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoo-dev/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoo-dev/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoo-dev/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/odoo-dev/odoo/languages","stargazers_url":"https://api.github.com/repos/odoo-dev/odoo/stargazers","contributors_url":"https://api.github.com/repos/odoo-dev/odoo/contributors","subscribers_url":"https://api.github.com/repos/odoo-dev/odoo/subscribers","subscription_url":"https://api.github.com/repos/odoo-dev/odoo/subscription","commits_url":"https://api.github.com/repos/odoo-dev/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoo-dev/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoo-dev/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoo-dev/odoo/issues/comments/{number}","contents_url":"https://api.github.com/repos/odoo-dev/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/odoo-dev/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoo-dev/odoo/merges","archive_url":"https://api.github.com/repos/odoo-dev/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoo-dev/odoo/downloads","issues_url":"https://api.github.com/repos/odoo-dev/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/odoo-dev/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/odoo-dev/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/odoo-dev/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoo-dev/odoo/labels{/name}","releases_url":"https://api.github.com/repos/odoo-dev/odoo/releases{/id}","created_at":"2014-05-16T11:16:19Z","updated_at":"2014-10-18T14:37:38Z","pushed_at":"2014-10-22T09:30:12Z","git_url":"git://github.com/odoo-dev/odoo.git","ssh_url":"git@github.com:odoo-dev/odoo.git","clone_url":"https://github.com/odoo-dev/odoo.git","svn_url":"https://github.com/odoo-dev/odoo","homepage":"https://www.odoo.com","size":954638,"stargazers_count":34,"watchers_count":34,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":9,"forks":11,"open_issues":9,"watchers":34,"default_branch":"master"}},"base":{"label":"odoo:master","ref":"master","sha":"97d99d1974c965506ed9005d4854fcc5ffee0590","user":{"login":"odoo","id":6368483,"avatar_url":"https://avatars.githubusercontent.com/u/6368483?v=2","gravatar_id":"","url":"https://api.github.com/users/odoo","html_url":"https://github.com/odoo","followers_url":"https://api.github.com/users/odoo/followers","following_url":"https://api.github.com/users/odoo/following{/other_user}","gists_url":"https://api.github.com/users/odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo/subscriptions","organizations_url":"https://api.github.com/users/odoo/orgs","repos_url":"https://api.github.com/users/odoo/repos","events_url":"https://api.github.com/users/odoo/events{/privacy}","received_events_url":"https://api.github.com/users/odoo/received_events","type":"Organization","site_admin":false},"repo":{"id":19745004,"name":"odoo","full_name":"odoo/odoo","owner":{"login":"odoo","id":6368483,"avatar_url":"https://avatars.githubusercontent.com/u/6368483?v=2","gravatar_id":"","url":"https://api.github.com/users/odoo","html_url":"https://github.com/odoo","followers_url":"https://api.github.com/users/odoo/followers","following_url":"https://api.github.com/users/odoo/following{/other_user}","gists_url":"https://api.github.com/users/odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoo/subscriptions","organizations_url":"https://api.github.com/users/odoo/orgs","repos_url":"https://api.github.com/users/odoo/repos","events_url":"https://api.github.com/users/odoo/events{/privacy}","received_events_url":"https://api.github.com/users/odoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odoo/odoo","description":"Odoo (formerly OpenERP). Open Source Apps To Grow Your Business.","fork":false,"url":"https://api.github.com/repos/odoo/odoo","forks_url":"https://api.github.com/repos/odoo/odoo/forks","keys_url":"https://api.github.com/repos/odoo/odoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odoo/odoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odoo/odoo/teams","hooks_url":"https://api.github.com/repos/odoo/odoo/hooks","issue_events_url":"https://api.github.com/repos/odoo/odoo/issues/events{/number}","events_url":"https://api.github.com/repos/odoo/odoo/events","assignees_url":"https://api.github.com/repos/odoo/odoo/assignees{/user}","branches_url":"https://api.github.com/repos/odoo/odoo/branches{/branch}","tags_url":"https://api.github.com/repos/odoo/odoo/tags","blobs_url":"https://api.github.com/repos/odoo/odoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odoo/odoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odoo/odoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/odoo/odoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odoo/odoo/statuses/{sha}","languages_url":"https://api.github.com/repos/odoo/odoo/languages","stargazers_url":"https://api.github.com/repos/odoo/odoo/stargazers","contributors_url":"https://api.github.com/repos/odoo/odoo/contributors","subscribers_url":"https://api.github.com/repos/odoo/odoo/subscribers","subscription_url":"https://api.github.com/repos/odoo/odoo/subscription","commits_url":"https://api.github.com/repos/odoo/odoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/odoo/odoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/odoo/odoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/odoo/odoo/issues/comments/{number}","contents_url":"https://api.github.com/repos/odoo/odoo/contents/{+path}","compare_url":"https://api.github.com/repos/odoo/odoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odoo/odoo/merges","archive_url":"https://api.github.com/repos/odoo/odoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odoo/odoo/downloads","issues_url":"https://api.github.com/repos/odoo/odoo/issues{/number}","pulls_url":"https://api.github.com/repos/odoo/odoo/pulls{/number}","milestones_url":"https://api.github.com/repos/odoo/odoo/milestones{/number}","notifications_url":"https://api.github.com/repos/odoo/odoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odoo/odoo/labels{/name}","releases_url":"https://api.github.com/repos/odoo/odoo/releases{/id}","created_at":"2014-05-13T15:38:58Z","updated_at":"2014-10-22T01:57:24Z","pushed_at":"2014-10-22T09:22:21Z","git_url":"git://github.com/odoo/odoo.git","ssh_url":"git@github.com:odoo/odoo.git","clone_url":"https://github.com/odoo/odoo.git","svn_url":"https://github.com/odoo/odoo","homepage":"https://www.odoo.com","size":920502,"stargazers_count":1443,"watchers_count":1443,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1059,"mirror_url":null,"open_issues_count":1288,"forks":1059,"open_issues":1288,"watchers":1443,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/odoo/odoo/pulls/894"},"html":{"href":"https://github.com/odoo/odoo/pull/894"},"issue":{"href":"https://api.github.com/repos/odoo/odoo/issues/894"},"comments":{"href":"https://api.github.com/repos/odoo/odoo/issues/894/comments"},"review_comments":{"href":"https://api.github.com/repos/odoo/odoo/pulls/894/comments"},"review_comment":{"href":"https://api.github.com/repos/odoo/odoo/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/odoo/odoo/pulls/894/commits"},"statuses":{"href":"https://api.github.com/repos/odoo/odoo/statuses/920bc3ddd8b8dfcd4b1225c726b40c8c6d71f165"}}}}