server icon indicating copy to clipboard operation
server copied to clipboard

Fix issues with certain mobile clients

Open Puyodead1 opened this issue 3 years ago • 2 comments

This PR fixes various issues that prevent mobile clients from connecting properly.

This has been tested with OpenCord and a patched version of the official Discord app.

Notable Changes:

  • [Message] edited_timestamp should return null instead of undefined as OC expects it to be present on the object
  • [API] Added GET /users/@me/settings
  • [Channel] Made NSFW not nullable. ~~It's a boolean... why would it be null...~~
  • [User] Added purchased_flags and premium_usage_flags
  • [User] Made mfa_enabled not nullable. ~~It's also a boolean... why would it be null...~~
  • [UserSettings] Added friend_discovery_flags, view_nsfw_guilds, passwordless, and banner_color
  • [Gateway] Added empty sessions and presences array to Ready payload
  • [Gateway] Updated identify payload schema with properties sent by the android clients
  • [Message] Disabled stripping null values (this is so edited_timestamp is actually returned, but this may cause an issue with bot clients apparently)
  • [API] GET /channels/:id/messages - Member object returns the members role ids
  • [Gateway] Replaced Node Built-in zlib library with fast-zlib as the built-in one wasn't working correctly
  • [Gateway] Implemented zlib inflation
  • [Gateway] Updated LazyRequest to accept guild_id as a string or a number. (Mobile clients send it as a number)
  • [Gateway] Updated VoiceStateUpdate to accept guild_id and channel_id as a string or a number. (Mobile clients send it as a number)

Current Known Issues:

  • There is an issue with premium where it looks like it's an object created from premium_type which causes issues with OpenCord since it expects a number. probably not a big deal image
  • ~~Member List is empty on mobile due to guild id being sent as a bigint and incorrectly parsed on the server~~ Fixed, thanks to maddy

Puyodead1 avatar Aug 18 '22 21:08 Puyodead1

is the last issue with premium_type much of an problem or could we start reviewing? only seems to affect opencord, official discord app works fine

Puyodead1 avatar Aug 25 '22 13:08 Puyodead1

Looks good to me, is that premium thing still an issue? Where does this occur, gateway or api? Is this ready for merging otherwise?

It's still an issue, I tested with fosscord staging image Afaik it's just the gateway. it only seems to cause issues for opencord so other than that, it should be ready for merge

Puyodead1 avatar Sep 09 '22 23:09 Puyodead1

Closing as the PR is now outdated, refactor already contains stuff from from PR.

Puyodead1 avatar Feb 09 '23 00:02 Puyodead1