1176 Commits

Author SHA1 Message Date
Mads Marquart
24c4b10012 Add thread tests 2019-10-27 14:40:09 +01:00
Mads Marquart
648cbb4999 Add location tests, and fix live location expires_at parsing 2019-10-27 14:40:09 +01:00
Mads Marquart
ef5c86c427 Add quick reply tests 2019-10-27 14:40:09 +01:00
Mads Marquart
5e0b80cada Add sticker tests 2019-10-27 14:40:09 +01:00
Mads Marquart
9898e8cd19 Add attachment tests 2019-10-27 14:40:09 +01:00
Mads Marquart
77d9b25bf0 Add utility function tests 2019-10-27 14:40:08 +01:00
Mads Marquart
e757e51a4e Remove most __init__ methods 2019-10-22 20:18:14 +02:00
Mads Marquart
ce8711ba65 Enable model comparisons 2019-10-22 20:04:08 +02:00
Mads Marquart
bdd7f69a66 Fix missing pytest 4.0 features
Not really sure how many versions of pytest we should support? But then
again, we might as well for now...
2019-09-10 21:22:28 +02:00
Mads Marquart
d06ff7078a Mark existing tests as online
- Remove `offline` and `expensive` markers
2019-09-10 10:59:01 +02:00
Mads Marquart
7416c8b7fc Make test setup more strict 2019-09-10 10:59:01 +02:00
Mads Marquart
fc7cc4ca38 Fix typo 2019-09-10 10:58:28 +02:00
Mads Marquart
614e5ad4bb Use snake_case method names
Renamed:
- Message.formatMentions
- _util.digitToChar
- _util.generateMessageID
- _util.getSignatureID
- _util.generateOfflineThreadingID
- Client._markAlive

Renamed following Client methods:
- isLoggedIn
- getSession
- setSession
- _forcedFetch
- fetchThreads
- fetchAllUsersFromThreads
- fetchAllUsers
- searchForUsers
- searchForPages
- searchForGroups
- searchForThreads
- searchForMessageIDs
- searchForMessages
- _fetchInfo
- fetchUserInfo
- fetchPageInfo
- fetchGroupInfo
- fetchThreadInfo
- fetchThreadMessages
- fetchThreadList
- fetchUnread
- fetchUnseen
- fetchImageUrl
- fetchMessageInfo
- fetchPollOptions
- fetchPlanInfo
- _getPrivateData
- getPhoneNumbers
- getEmails
- getUserActiveStatus
- fetchThreadImages
- _oldMessage
- _doSendRequest
- quickReply
- _sendLocation
- sendLocation
- sendPinnedLocation
- _sendFiles
- sendRemoteFiles
- sendLocalFiles
- sendRemoteVoiceClips
- sendLocalVoiceClips
- forwardAttachment
- createGroup
- addUsersToGroup
- removeUserFromGroup
- _adminStatus
- addGroupAdmins
- removeGroupAdmins
- changeGroupApprovalMode
- _usersApproval
- acceptUsersToGroup
- denyUsersFromGroup
- _changeGroupImage
- changeGroupImageRemote
- changeGroupImageLocal
- changeThreadTitle
- changeNickname
- changeThreadColor
- changeThreadEmoji
- reactToMessage
- createPlan
- editPlan
- deletePlan
- changePlanParticipation
- createPoll
- updatePollVote
- setTypingStatus
- markAsDelivered
- _readStatus
- markAsRead
- markAsUnread
- markAsSeen
- friendConnect
- removeFriend
- blockUser
- unblockUser
- moveThreads
- deleteThreads
- markAsSpam
- deleteMessages
- muteThread
- unmuteThread
- muteThreadReactions
- unmuteThreadReactions
- muteThreadMentions
- unmuteThreadMentions
- _pullMessage
- _parseMessage
- _doOneListen
- setActiveStatus
- onLoggingIn
- on2FACode
- onLoggedIn
- onListening
- onListenError
- onMessage
- onColorChange
- onEmojiChange
- onTitleChange
- onImageChange
- onNicknameChange
- onAdminAdded
- onAdminRemoved
- onApprovalModeChange
- onMessageSeen
- onMessageDelivered
- onMarkedSeen
- onMessageUnsent
- onPeopleAdded
- onPersonRemoved
- onFriendRequest
- onInbox
- onTyping
- onGamePlayed
- onReactionAdded
- onReactionRemoved
- onBlock
- onUnblock
- onLiveLocation
- onCallStarted
- onCallEnded
- onUserJoinedCall
- onPollCreated
- onPollVoted
- onPlanCreated
- onPlanEnded
- onPlanEdited
- onPlanDeleted
- onPlanParticipation
- onQprimer
- onChatTimestamp
- onBuddylistOverlay
- onUnknownMesssageType
- onMessageError
2019-09-08 19:59:53 +02:00
Mads Marquart
8d8ef6bbc9 Merge pull request #466 from carpedm20/various-removals
Various removals
2019-09-08 18:51:20 +02:00
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
2e88bd49d4 Merge pull request #472 from carpedm20/use-datetime
Use datetime/timedelta objects
2019-09-08 18:41:41 +02:00
Mads Marquart
813219cd9c Bump version: 1.8.2 → 1.8.3 v1.8.3 2019-09-08 15:59:29 +02:00
Asiel Díaz Benítez
bb1f7d9294 Fix mimetypes.guess_type (#471)
`mimetypes.guess_type` fails if the url is something like `http://example.com/file.zip?u=10`.

Backported from 6bffb66
2019-09-08 15:58:34 +02:00
Asiel Díaz Benítez
6bffb66b5e Fix mimetypes.guess_type (#471)
`mimetypes.guess_type` fails if the url is something like `http://example.com/file.zip?u=10`.
2019-09-08 15:56:27 +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
2e53963398 Make LiveLocationAttachment.expires_at a datetime object
Renamed from .expiration_time
2019-09-08 15:24:58 +02:00
Mads Marquart
61842b199f Make ActiveStatus.last_active a datetime object 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
d12f9fd645 Add datetime helper functions 2019-09-08 15:20:30 +02:00
Mads Marquart
a6a3768a38 Fix _util.now() usage in Client 2019-09-08 13:15:11 +02:00
Mads Marquart
3d28c958d3 Bump version: 1.8.1 → 1.8.2 v1.8.2 2019-09-05 20:07:44 +02:00
Marco Gavelli
6b68916d74 Fix Python 2 only issue (str.split does not take keyword parameters)
Fixes #469
2019-09-05 20:02:51 +02:00
Mads Marquart
8052b818de Small fixes 2019-08-28 23:03:31 +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
d84ad487ee Merge pull request #465 from carpedm20/drop-python-2
Drop Python 2 support
2019-08-28 22:01:10 +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
6fb6e707ba Remove six dependency 2019-08-28 21:26:59 +02:00
Mads Marquart
330473a092 Update PyPI classifiers and required python version 2019-08-28 21:24:59 +02:00
Mads Marquart
5ee93b760a Update badges
- Update version numbers
- Use badgen.net instead of shields.io
- Remove badges from the docs (they're only present in the README)
2019-08-28 21:24:09 +02:00