Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct Messages and other fixes #369

Merged
merged 11 commits into from
Sep 18, 2021
Merged

Conversation

AlTech98
Copy link
Contributor

@AlTech98 AlTech98 commented Sep 16, 2021

Done:

  • DMs and group DMs should work
  • Fix bug with discriminator starting with 0
  • Fix user's public_flags type string -> number
  • Keep user's DMs closed states, fix DM channel bookkeeping #365
  • Fix gateway permission check, Thanks @Flam3rboy
  • Fix bug in GET /channels/#channel_id/messages/ around/before/after
  • Fix READY event users
  • GET /users/@me/relationships
  • PUT /channels/#channel_id/recipients, fix Route: /channels/:id/recipients/:id #19
  • DELETE /channels/#channel_id/recipients, fix Route: /channels/:id/recipients/:id #19
  • Dummy GET /sticker-packs
  • Dummy GET /sticker-packs/#id

TODO:

  • Fix gateway not sending events to channels created after the websocket connection has been made
  • Fix gateway keep sending events to users that left the group dm channel until they refresh the page
  • Remove console.log() from gateway listener and emitEvent()
  • GET /users/@me/channels
  • Change owner_id in a group dm if the current owner quit
  • Delete group dm channel if everyone leave
  • Should guild invite list DM groups?
  • DM groups icon

In util i also added service and dto layers to keep the code cleaner

Copy link
Member

@SamuelScheit SamuelScheit left a comment

Choose a reason for hiding this comment

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

Also can you explain what you doing with Recipient.closed?

api/src/routes/channels/#channel_id/messages/index.ts Outdated Show resolved Hide resolved
api/src/routes/users/@me/channels.ts Outdated Show resolved Hide resolved
util/src/services/ChannelService.ts Outdated Show resolved Hide resolved
util/src/util/Event.ts Outdated Show resolved Hide resolved
@AlTech98
Copy link
Contributor Author

Also can you explain what you doing with Recipient.closed?

It's needed to fix #365, if a user close a dm channel in the client we need to set it as closed to prevent sending the channel in the READY event, this way it doesn't reappear in the gui until the user reopen it by trying to send a DM to the other recipient

@AlTech98 AlTech98 marked this pull request as ready for review September 18, 2021 16:40
@AlTech98
Copy link
Contributor Author

Everything should work now, the only problem is that the gateway doesn't properly remove listener but it does that for everything not only DMs

@SamuelScheit
Copy link
Member

Then we can merge the PR and work on the fix in another one

@SamuelScheit SamuelScheit merged commit 5d0acf5 into spacebarchat:master Sep 18, 2021
@AlTech98 AlTech98 deleted the fix-dm branch September 19, 2021 07:11
@erkinalp erkinalp self-requested a review September 19, 2021 14:54
MaddyUnderStars pushed a commit that referenced this pull request Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DM channel bookkeeping Route: /channels/:id/recipients/:id
2 participants