Skip to content

Comments

New methods [HUGE UPDATE]#318

Merged
madsmtm merged 69 commits intofbchat-dev:masterfrom
kapi2289:master
Aug 29, 2018
Merged

New methods [HUGE UPDATE]#318
madsmtm merged 69 commits intofbchat-dev:masterfrom
kapi2289:master

Conversation

@kapi2289
Copy link
Contributor

@kapi2289 kapi2289 commented Jul 16, 2018

Added:

  • Detecting change of the thread image onImageChange Way to detect changes in the group image #315
  • Fetching Message object from message ID fetchMessageInfo
  • Group managment methods addGroupAdmins, removeGroupAdmins, changeGroupApprovalMode, acceptUsersToGroup, denyUsersFromGroup,
    and detecting them onAdminsAdded, onAdminsRemoved, onApprovalModeChange
  • Blocking users blockUser, unblockUser
  • Moving threads moveThreads Accept request message for new contact #177
  • Deleting threads deleteThreads
  • Deleting messages deleteMessages
  • Muting threads muteThread, muteThreadReactions, muteThreadMentions
    and unmuting unmuteThread, unmuteThreadReactions, unmuteThreadMentions
  • Marking threads as unread markAsUnread
  • Marking as read multiple threads markAsRead
  • Marking thread as spam and deleting it markAsSpam
  • Waving to a thread wave
  • Searching for messages searchForMessageIDs, searchForMessages
  • Detecting group call events onCallStarted, onCallEnded, onUserJoinedCall
  • Detecting game events onGamePlayed
  • Few fixes in code
  • Polls
    • Poll, PollOption models
    • Poll methods createPoll, updatePollVote
    • Fetching poll options fetchPollOptions
    • Detecting poll events onPollCreated, onPollVoted
  • Event reminders rebuild
    • Plan model
    • Plan methods createPlan, editPlan, deletePlan, changePlanParticipation
    • Fetching Plan object from event ID fetchEventInfo
    • Detecting plan events onPlanCreated, onPlanEnded, onPlanEdited,
      onPlanParticipation
  • Attachments sending rebuild [Feature] Send attachments #194 AudioAttachment #308 sending .avi on chat ? #321
    • Sending all types of files sendRemoteFiles, sendLocalFiles
    • Sending from ID _sendFiles

kapi2289 added 3 commits July 16, 2018 21:46
Added: addGroupAdmin, removeGroupAdmin, changeGroupApprovalMode, blockUser, unblockUser, moveThread, onImageChange, onAdminsAdded, onAdminsRemoved, onApprovalModeChange
I did this all day, because I love this library and I want to be part of it :D
@kapi2289 kapi2289 changed the title Small typo fix New methods [HUGE UPDATE] Jul 19, 2018
@kapi2289
Copy link
Contributor Author

I spent whole day for this update. Hope it will be approved :D

kapi2289 added 5 commits July 20, 2018 11:51
Changed
addGroupAdmin, removeGroupAdmin
to
addGroupAdmins, removeGroupAdmins
@kapi2289
Copy link
Contributor Author

kapi2289 commented Jul 20, 2018

I think I made too many commits. If you want I will make a new pull request.

Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution (!!! 🎉🎉🎉 !!!), I've been wanting to make these implementations myself, but I've just been putting it off. I didn't have time to look through the whole PR, and I'm going away on another vacation for the next two weeks, but I'll look into it when I get back.

@kapi2289
Copy link
Contributor Author

Actually I have problems with logging to my Facebook account by fbchat so I can't make some of this changes. When I'll fix this I'll make changes, thank you!

@kapi2289
Copy link
Contributor Author

kapi2289 commented Jul 30, 2018

I made it! I found request (_forcedFetch method) to fetch information about the changed thread image. This request can also fetch information about every message by mid and thread_id! I added onGamePlayed, changed moveThread to moveThreads (multiple) and added helper method _adminStatus. Thank you!

user['profile_picture'] = {}
c_info = get_customization_info(user)
plan = graphql_to_plan(user['event_reminders']['nodes'][0]) if user.get('event_reminders') else None
plan = graphql_to_plan(user['event_reminders']['nodes'][0]) if user.get('event_reminders', dict()).get('nodes') else None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be aware that user.get('event_reminders', dict()).get('nodes') can still raise an AttributeError, on data that looks like e.g:

user = {
    'event_reminders': None
}

But it might not be necessary to check this case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen None in event_reminders, but maybe I'm wrong.

@madsmtm
Copy link
Member

madsmtm commented Aug 23, 2018

I couldn't explain what I meant, so I went ahead and changed sendLocalFiles and sendRemoteFiles, so you don't need to input the filetypes.

Now all that's left is to test it all... 😦

@madsmtm
Copy link
Member

madsmtm commented Aug 29, 2018

I've made a bunch of tests for the methods you've added, though the search methods are still missing tests (haven't found a good way to set up tests for that yet). But I've tested them myself, and they look good. I'll merge this now, then and in a few days I'll make a new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants