From c4aa6b4523c2b2de7badc2c7dd9b9c517b7ffbe2 Mon Sep 17 00:00:00 2001 From: Mads T Marquart Date: Fri, 5 May 2017 21:15:43 +0200 Subject: [PATCH 1/2] Update client.py --- fbchat/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbchat/client.py b/fbchat/client.py index 0595db34..8d110694 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -616,7 +616,7 @@ def getThreadInfo(self, userID, last_n=20, start=None, is_user=True): # `start` doesn't matter, always returns from the last # data['messages[{}][{}][offset]'.format(key, userID)] = start data = {'messages[{}][{}][offset]'.format(key, userID): 0, - 'messages[{}][{}][limit]'.format(key, userID): last_n, + 'messages[{}][{}][limit]'.format(key, userID): last_n - 1, 'messages[{}][{}][timestamp]'.format(key, userID): now()} r = self._post(MessagesURL, query=data) From 2aa1978274cb66dab90e927d333fc8b53686ba24 Mon Sep 17 00:00:00 2001 From: Mads T Marquart Date: Fri, 5 May 2017 21:17:35 +0200 Subject: [PATCH 2/2] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 816e6a02..87b5249f 100644 --- a/README.rst +++ b/README.rst @@ -61,7 +61,7 @@ Getting last messages sent .. code-block:: python - last_messages = client.getThreadInfo(friend.uid,0) + last_messages = client.getThreadInfo(friend.uid, last_n=20) last_messages.reverse() # messages come in reversed order for message in last_messages: