Commit Graph

419 Commits

Author SHA1 Message Date
Zane Helton 81d4313631 Properly filter existing embed links
In a previous PR, I was checking if the `.url` property existed, the
correct fix is to remove any embed that isn't a rich embed
type (non-link).

See also: #1296
2025-06-29 08:39:42 +10:00
Zane Helton 184433b078 Start fresh when updating embeds for links
In a previous commit I was attempting to be clever by only
replacing/removing embeds if necessary. This not only made the logic
more confusing but introduced a bug that would allow for orphaned
embeds when updating the search params of a URL.

This commit will remove all embeds that have a `.url` property and start
fresh. This simplifies the code and eliminates the aforementioned bug.
2025-06-28 18:30:52 +10:00
Zane Helton f9cfb46e73 Fix various issues with embeds on message updates
The `postHandleMessage` function is parsing links and adding them to the
EmbedCache table if necessary. In the previous implementation, message
updates would push to the embeds unconditionally.

This commit parses links from the message and:

1. Normalizes the URLs
  - Useful for deduplicating similar URLs
2. Remove embeds with matching normalized URLs
  - Leaves all embeds except for ones with a `.url` property matching
  the updated message
  - This allows embeds to be re-ordered if the URL is moved
3. If no normalized URLs are found, remove all embeds
4. Take the deduplicated + normalized URLs and add an embed to the message and
insert into the EmbedCache table (if necessary)

This enables:

1. Embeds to be re-ordered by re-ordering links
2. Embeds to be removed by removing links

and fixes:

1. Duplicate embeds being attached to a message when edited
2025-06-28 18:30:52 +10:00
Zane Helton c0f9c22e67 Add validation to date_of_birth registration field
Resolves: #1020
2025-06-28 17:08:00 +10:00
dank074 526a8da8f5 add webrtc support (#1284)
Co-authored-by: MaddyUnderStars <46743919+MaddyUnderStars@users.noreply.github.com>
2025-06-22 12:41:13 +10:00
MathMan05 f03c6209a4 send the real index 2025-05-28 08:46:35 +02:00
MathMan05 e219c1a33a code relies on things done in a certain order
This makes sure that the code gets done in the order that is expected
2025-05-28 08:46:35 +02:00
MathMan05 4f6211ce50 remove missed log 2025-05-28 08:46:35 +02:00
MathMan05 04ddfadbb6 sort array to make algorithm happy 2025-05-28 08:46:35 +02:00
MathMan05 91361ea9c6 fix another stupid bug 2025-05-28 08:46:35 +02:00
MathMan05 1550ccd099 don't set possition if sent 2025-05-28 08:46:35 +02:00
MathMan05 246b493d76 remove logs 2025-05-28 08:46:35 +02:00
MathMan05 5488874476 delete the null eater 2025-05-28 08:46:35 +02:00
MathMan05 af70a7f21b channel is nullable fixes 2025-05-28 08:46:35 +02:00
MathMan05 a4c50ae922 forgot to test on rebuild 2025-05-28 08:46:35 +02:00
MathMan05 a9bff7554a fix moving channels 2025-05-28 08:46:35 +02:00
Puyodead1 080b2c7d38 Implement signed cdn urls 2025-05-03 12:30:22 +02:00
dank074 bb84bc83e5 add author to query in pins API 2025-04-09 18:42:56 -05:00
Emma [it/its]@Rory& 126a881f31 Prettier 2025-04-09 16:38:03 +02:00
Emma [it/its]@Rory& ebc063df97 Fix dependencies 2025-04-09 16:38:03 +02:00
MathMan05 d267b08ab5 stupid fix 2025-04-03 12:53:03 -05:00
MathMan05 99cc009670 fix password reset bug
Not sure if this'll work, but made a pull so y'all could see the issue
2025-04-03 12:52:11 -05:00
root d8b1a8484c Validate Name for webhooks enforced more 2025-03-25 16:02:47 -07:00
root cabc49a1ba Added can_recover_account value to /api/policies/instance/config 2025-03-25 11:26:36 -07:00
root 541af2045d Added better user configuration and removed extra logging 2025-03-25 11:15:14 -07:00
Munchy 7320aa4529 Merge branch 'spacebarchat:master' into master 2025-03-24 10:35:27 -04:00
root d0948c0e49 Updated error message for empty webhook update body 2025-03-24 07:29:56 -07:00
root 859edb9a27 Added Name Validation utility function 2025-03-24 07:26:26 -07:00
MathMan05 664b71f463 acatually fix the embed issue
This one added the line in the right spot, sorry about the previous one lol
2025-03-23 23:29:19 -05:00
root b03888fd62 Merge branch 'master' of https://github.com/spacebarchat/server into update_webhooks 2025-03-23 16:33:24 -07:00
root 336b2df1d7 Fixed errors in authorization for webhooks with tokens 2025-03-23 16:28:25 -07:00
Puyodead1 05520665dc Merge pull request #1205 from DEVTomatoCake/feat/dont-send-x-powered-by
Stop sending X-Powered-By & use API CORS + BodyParser middlewares in CDN
2025-03-23 14:20:32 -04:00
MathMan05 90287748ce Update index.ts 2025-03-23 13:13:03 -05:00
MathMan05 109bf0da7c fix minor bug 2025-03-22 23:03:33 -05:00
root dda930d501 Added in date wrap on generate-registration-tokens.ts 2025-03-19 09:36:13 -07:00
Puyodead1 8c7fabfe40 implement hubs routes 2025-01-07 21:12:43 -05:00
dank074 f5d6394c38 run prettier 2024-11-19 14:19:40 -06:00
Cyber 9384138dd4 Merge branch 'master' into fix/user-profile-colors 2024-11-14 07:58:16 +01:00
dank074 f499507698 turn off eslint rules causing issues 2024-11-13 19:05:54 -06:00
CyberL1 a11f3c0409 fix: return user profile theme colors as numbers 2024-11-12 13:48:52 +01:00
Emma [it/its]@Rory& 40b356ecdf Add express trustedProxy support 2024-10-30 16:28:57 +01:00
MathMan05 6a0d0f4185 Fix the broken delete API 2024-10-29 17:42:52 -05:00
Emma [it/its]@Rory& 2feb90475e Fix module resolution when $CWD != . 2024-10-28 00:32:18 +01:00
Emma [it/its]@Rory& 168758924c Update some patches, switch to node-fetch-commonjs, more updates 2024-10-28 00:32:15 +01:00
Cyber 246e80c095 fix: self nick change response 2024-09-03 14:13:52 +02:00
TomatoCake ff1ed0d744 Fix uploading of emojis 2024-09-02 19:39:32 +02:00
TomatoCake e807037145 Add more application properties 2024-08-31 11:04:18 +02:00
TomatoCake 342ef1b20f Stop sending X-Powered-By & share CORS/BodyParser 2024-08-31 07:29:55 +02:00
TomatoCake 860e636c6e Enforce RegEx no auth routes start 2024-08-30 14:49:27 +02:00
TomatoCake 03c050ae8b Fix HEAD requests for no authorization routes 2024-08-30 14:46:27 +02:00