Commit Graph

132 Commits

Author SHA1 Message Date
Mads Marquart
5aed7b0abc Remove login retrying
Unnecessary clutter, easy to implement if required by the user.
2019-09-08 18:44:46 +02:00
Mads Marquart
856c1ffe0e Remove ability to control the listening loop externally
It was probably scarcely used, and separate functionality will be
developed that makes this redundant anyhow.
2019-09-08 18:44:46 +02:00
Mads Marquart
650112a592 Remove automatic fb_dtsg refreshing
This was error prone, inefficient and wouldn't handle all error cases.
The real solution is to make some way to retry the request in the
general case (since you can alway just get logged out), and that's
probably out of scope for this project, at least right now. :/
2019-09-08 18:44:46 +02:00
Mads Marquart
b5a37e35c6 Remove FBchatUserError in favor of builtin exceptions 2019-09-08 18:44:46 +02:00
Mads Marquart
91cf4589a5 Remove ability to set a custom User-Agent
This causes issues if the User-Agent is set to resemble a mobile phone,
see #431, and besides, it's not an API surface I want / need to support.
2019-09-08 18:44:46 +02:00
Mads Marquart
4155775305 Remove ssl_verify property
Only used when debugging, and in that case, the functionality could be
implemented using private APIs.
2019-09-08 18:44:45 +02:00
Mads Marquart
7c758501fc Remove methods to set the default thread
This has been done to value explicitness over implicitness, and also
since the question of whether thread_id=None is acceptable was dependent
on mutable variables in Client.
2019-09-08 18:44:45 +02:00
Mads Marquart
c70a39c568 Remove deprecated arguments, methods, and classes 2019-09-08 18:44:06 +02:00
Mads Marquart
72ab8695f1 Make ts a datetime, and rename to at in all onX methods 2019-09-08 15:24:58 +02:00
Mads Marquart
47bdb84957 Make seen_ts a datetime, and rename to seen_at in onX methods
- onMessageSeen
- onMarkedSeen
2019-09-08 15:24:58 +02:00
Mads Marquart
24cf4047b7 Convert durations to timedeltas
On:
- AudioAttachment.duration
- VideoAttachment.duration
- Client.onCallEnded call_duration argument
- Client.muteThread mute_time argument
2019-09-08 15:24:58 +02:00
Mads Marquart
aef64e5c29 Make Message.timestamp a datetime object, and rename to .created_at 2019-09-08 15:24:58 +02:00
Mads Marquart
6d13937c4a Make Plan.time a datetime object 2019-09-08 15:24:57 +02:00
Mads Marquart
4b34a063e8 Rename Thread.last_message_timestamp to .last_active, and use datetimes 2019-09-08 15:20:31 +02:00
Mads Marquart
ba088d45a7 Make Client fetching methods use datetime objects
On:
- Client.fetchThreads after and before arguments
- Client.fetchThreadMessages before argument
- Client.fetchThreadList before argument
2019-09-08 15:20:31 +02:00
Mads Marquart
a6a3768a38 Fix _util.now() usage in Client 2019-09-08 13:15:11 +02:00
Mads Marquart
da4ed73ec6 Remove models.py 2019-08-28 22:59:22 +02:00
Mads Marquart
62c9512734 Clean up imports 2019-08-28 22:44:42 +02:00
Mads Marquart
d3a0ffc478 Fix logging
- Following advice here: https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
- Renamed the logger: client -> fbchat
- Remove logging_level init parameter from Client
- Use print instead of log.info in examples
2019-08-28 22:27:29 +02:00
Mads Marquart
01b80b300e Remove explicit new style class declarations 2019-08-28 21:57:50 +02:00
Mads Marquart
66505f8f41 Remove redundant encoding specifiers and __future__ imports 2019-08-28 21:57:46 +02:00
Mads Marquart
75378bb709 Remove Python 2 specific imports 2019-08-28 21:37:16 +02:00
Mads Marquart
1f342d0c71 Move Client._getSendData into the Thread / Group models 2019-08-28 18:07:21 +02:00
Mads Marquart
0838f84859 Move most of Client._getSendData to State._do_send_request 2019-08-28 18:07:21 +02:00
Mads Marquart
4d13cd2c0b Move body of Client._doSendRequest to State 2019-08-28 18:07:21 +02:00
Mads Marquart
8f8971c706 Move parts of Client._getSendData to Message._to_send_data 2019-08-28 18:07:21 +02:00
Mads Marquart
2703d9513a Move Client._client_id to State 2019-08-28 18:07:21 +02:00
Mads Marquart
3dce83de93 Move Client._upload to State 2019-08-28 18:07:21 +02:00
Mads Marquart
ef8e7d4251 Move user id handling to State 2019-08-28 18:07:21 +02:00
Mads Marquart
a131e1ae73 Move body of Client.graphql_requests to State._graphql_requests 2019-08-28 18:07:21 +02:00
Mads Marquart
84a86bd7bd Move body of Client._payload_post to State 2019-08-28 18:07:21 +02:00
Mads Marquart
adfb5886c9 Move body of Client._post to State 2019-08-28 18:07:21 +02:00
Mads Marquart
8d237ea4ef Move body of Client._get to State 2019-08-28 18:07:21 +02:00
Mads Marquart
513bc6eadf Move Client._do_refresh to State 2019-08-28 18:07:21 +02:00
Mads Marquart
7c68a29181 Stop using Client.graphql_request internally 2019-07-25 23:32:17 +02:00
Mads Marquart
2f4e3f2bb1 Remove Client._generatePayload
Make Client._get and Client._post require a query input
2019-07-25 20:20:26 +02:00
Mads Marquart
83c45dcf40 Fix spelling / typesetting in various places 2019-07-24 16:18:15 +02:00
Mads Marquart
cc9d81a39e Fix spelling mistakes in documentation 2019-07-24 16:18:15 +02:00
Mads Marquart
dbb20b1fdc Convert various directives to Google style sections 2019-07-24 13:45:33 +02:00
Mads Marquart
beee209249 Convert :return: / :rtype: roles to Returns sections 2019-07-24 13:45:33 +02:00
Mads Marquart
d6876ce13b Convert :raises: roles to Raises sections 2019-07-24 13:43:34 +02:00
Mads Marquart
ed05d16a31 Move :type: roles into the Args sections 2019-07-24 13:43:34 +02:00
Mads Marquart
3806f01d2f Convert :param: roles to Args sections 2019-07-24 13:43:30 +02:00
Mads Marquart
6b07f1d8b9 Fix first line of docstrings
- Use the imperative sense
- Use trailing dot
- Omit leading newline
- Grammar / vocabulary fixes
2019-07-24 13:43:01 +02:00
Przemek
700cf14a50 Add fetchThreadImages (#434) 2019-07-24 13:40:00 +02:00
Mads Marquart
e136d77ade Fix 2FA login error, closes #442, replaces #443 2019-07-20 16:00:32 +02:00
Mads Marquart
d279c96dd5 Make docs parsing "nitpicky" 2019-07-03 23:18:02 +02:00
Mads Marquart
47c744e5e2 Fix reST any roles/references 2019-07-03 17:35:38 +02:00
Mads Marquart
708869ea93 Include missing models in auto-generated API docs 2019-07-03 17:19:11 +02:00
Mads Marquart
ba7572eddd Merge branch 'master' into graphql-cleanup 2019-07-02 19:17:53 +02:00