GitHub PullRequestReviewCommentEvent at 2014-02-14 14:22:15
Repository: leap_mail
Actor: ivanalejandro0
Payload: {"comment":{"url":"https://api.github.com/repos/leapcode/leap_mail/pulls/comments/9749227","id":9749227,"diff_hunk":"@@ -224,34 +267,31 @@ def create_message(self, mbox, uid, message, observer,\n                                be fired.\n         :type notify_on_disk: bool\n         \"\"\"\n-        log.msg(\"adding new doc to memstore %r (%r)\" % (mbox, uid))\n+        log.msg(\"Adding new doc to memstore %r (%r)\" % (mbox, uid))\n         key = mbox, uid\n \n         self._add_message(mbox, uid, message, notify_on_disk)\n         self._new.add(key)\n \n-        # XXX use this while debugging the callback firing,\n-        # remove after unittesting this.\n-        #def log_add(result):\n-            #return result\n-        #observer.addCallback(log_add)\n-\n-        if notify_on_disk:\n-            # We store this deferred so we can keep track of the pending\n-            # operations internally.\n-            # TODO this should fire with the UID !!! -- change that in\n-            # the soledad store code.\n-            self._new_deferreds[key] = observer\n-        if not notify_on_disk:\n-            # Caller does not care, just fired and forgot, so we pass\n-            # a defer that will inmediately have its callback triggered.\n-            observer.callback(uid)\n+        if observer is not None:\n+            if notify_on_disk:\n+                # We store this deferred so we can keep track of the pending\n+                # operations internally.\n+                # TODO this should fire with the UID !!! -- change that in\n+                # the soledad store code.\n+                self._new_deferreds[key] = observer\n+\n+            else:\n+                # Caller does not care, just fired and forgot, so we pass\n+                # a defer that will inmediately have its callback triggered.\n+                self.reactor.callFromThread(observer.callback, uid)\n+","path":"src/leap/mail/imap/memorystore.py","position":181,"original_position":181,"commit_id":"02a9edd6ef7a0c632eb4a298cbbf95bb054948aa","original_commit_id":"02a9edd6ef7a0c632eb4a298cbbf95bb054948aa","user":{"login":"ivanalejandro0","id":806502,"avatar_url":"https://gravatar.com/avatar/1649a5e9f614b7131595182b8af1ad18?d=https%3A%2F%2Fidenticons.github.com%2Ffa760466dde723e1cabcc1cacb5cd07f.png&r=x","gravatar_id":"1649a5e9f614b7131595182b8af1ad18","url":"https://api.github.com/users/ivanalejandro0","html_url":"https://github.com/ivanalejandro0","followers_url":"https://api.github.com/users/ivanalejandro0/followers","following_url":"https://api.github.com/users/ivanalejandro0/following{/other_user}","gists_url":"https://api.github.com/users/ivanalejandro0/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanalejandro0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanalejandro0/subscriptions","organizations_url":"https://api.github.com/users/ivanalejandro0/orgs","repos_url":"https://api.github.com/users/ivanalejandro0/repos","events_url":"https://api.github.com/users/ivanalejandro0/events{/privacy}","received_events_url":"https://api.github.com/users/ivanalejandro0/received_events","type":"User","site_admin":false},"body":"not needed blank line","created_at":"2014-02-14T14:22:15Z","updated_at":"2014-02-14T14:22:15Z","html_url":"https://github.com/leapcode/leap_mail/pull/128#discussion_r9749227","pull_request_url":"https://api.github.com/repos/leapcode/leap_mail/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/leapcode/leap_mail/pulls/comments/9749227"},"html":{"href":"https://github.com/leapcode/leap_mail/pull/128#discussion_r9749227"},"pull_request":{"href":"https://api.github.com/repos/leapcode/leap_mail/pulls/128"}}}}