Skip to content

Commit

Permalink
Modify handler and callback calling order.
Browse files Browse the repository at this point in the history
 before
 callback -> handler
  after
  handler -> callback
  • Loading branch information
kimwz committed Aug 25, 2016
1 parent 2ea9007 commit f344ebe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fbmq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.7.0b3'
__version__ = '1.7.0b4'

from .fbmq import QuickReply, Page
from . import attachment as Attachment
Expand Down
4 changes: 2 additions & 2 deletions fbmq/fbmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def handle_webhook(self, payload, optin=None, message=None, echo=None, delivery=
if event.get("message", {}).get("is_echo"):
self._call_handler('echo', echo, event)
else:
self._call_handler('message', message, event)
if self.is_quick_reply(event) and self.has_quick_reply_callback(event):
self.call_quick_reply_callback(event)
self._call_handler('message', message, event)
elif 'delivery' in event:
self._call_handler('delivery', delivery, event)
elif 'postback' in event:
self._call_handler('postback', postback, event)
if self.has_postback_callback(event):
self.call_postback_callback(event)
self._call_handler('postback', postback, event)
elif 'read' in event:
self._call_handler('read', read, event)
elif 'account_linking' in event:
Expand Down

0 comments on commit f344ebe

Please sign in to comment.