64 Commits

Author SHA1 Message Date
murdle
03dbf7026e add basic push notification provider 2025-12-21 15:08:51 +02:00
murdle
155d670b6d add notification sending on messages 2025-12-10 23:55:55 +02:00
MathMan05
a5b5129542 fixes 2025-11-19 11:42:08 -06:00
MathMan05
76263bca68 add missing awaits 2025-11-19 11:08:56 -06:00
MathMan05
d42519e330 fix mentions issues 2025-11-19 10:58:27 -06:00
Cyber
86f36dcc68
Merge branch 'master' into readStates 2025-11-19 15:20:12 +01:00
MathMan05
77022c0afb implement mention_count 2025-11-18 18:19:58 -06:00
MathMan05
afa6363961 more fix 2025-11-18 15:59:46 -06:00
MathMan05
9db3e4a616 I am an idiot, it wasn't backwards 2025-11-18 15:42:17 -06:00
MathMan05
4b14bae282 fix 2025-11-18 15:17:38 -06:00
MathMan05
c7201d09aa rename varriable 2025-11-17 17:40:52 -06:00
MathMan05
96dfb645bb add spacing 2025-11-17 17:40:32 -06:00
MathMan05
e265e5ccf0 fix ping error bug 2025-11-17 17:39:30 -06:00
MathMan05
7c26fc5919 fix full user object being exposed 2025-10-30 18:10:16 -05:00
Rory&
e52c237326 Reorganise schemas a little bit 2025-10-15 08:04:23 +02:00
Rory&
62016a8043 Try to fix sending messages with discord-go 2025-10-06 03:25:11 +02:00
Rory&
0c3d8a792f Drop @sentry/node (Sentry support) - untested and unused 2025-09-29 22:08:03 +02:00
Rory&
697b599eb5 Maybe this tie 2025-09-29 18:38:06 +02:00
Rory&
61c3b537ad Include attachments 2025-09-29 18:38:06 +02:00
Rory&
b6cfb32d5a More relations 2025-09-29 18:38:06 +02:00
Rory&
871880996b Actually set the referenced_message relation on new messages 2025-09-29 18:38:06 +02:00
Rory&
f20dff80ef Make cloud uploads work 2025-09-29 18:38:06 +02:00
Rory&
d007acc64e Logging of empty messages 2025-09-29 18:38:06 +02:00
Rory&
c3fa8d3b1f meow??? 2025-09-29 18:38:06 +02:00
Rory&
3bba7882fa Try to handle new attachment style in message handler 2025-09-29 18:38:06 +02:00
Zane Helton
4f75919651 Add OP to message.mentions when replied to
The `message.message_reference` stores:

1. `message_id`
2. `channel_id`
3. `guild_id`

We use the `message_id` and `channel_id` to `.findOne(...)` Message, and
find the author. If the author is the same as OP, we skip (so replying
to yourself doesn't add you to the mentions array) otherwise, it adds
the author_id to the mentions array.

Resolves: #1247
2025-06-29 09:14:58 +10:00
Zane Helton
e8d3f655a3 Preserve reactions when a message is edited
Resolves #1241
2025-06-29 08:44:47 +10:00
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
Emma [it/its]@Rory&
168758924c Update some patches, switch to node-fetch-commonjs, more updates 2024-10-28 00:32:15 +01:00
TomatoCake
873107f90d Perms for GET webhook, url property 2024-07-18 15:16:50 +02:00
TomatoCake
15a2e57b05 Prettier & fix merge util/handlers/Message 2024-07-18 14:42:22 +02:00
TomatoCake
128b81bc6a Merge branch 'master' of https://github.com/DEVTomatoCake/spacebar-server into feat/webhooks-3 2024-07-18 14:41:14 +02:00
TomatoCake
6be3714593 Fix ESLint & prettier 2024-07-18 12:52:00 +02:00
TomatoCake
e7a98b6c46 webhook fixes & username/avatar property for msg 2024-07-18 12:42:07 +02:00
TomatoCake
d3ece937e6 Make channel ID optional when replying 2024-07-17 20:34:09 +10:00
Cyber
7698a15f03 fix: check for message components 2024-07-09 17:19:28 +02:00
Cyber
21579b11cd fix: poll message is not an empty message 2024-07-09 16:02:11 +02:00
TomatoCake
9b02e82614 Make poll a single object instead of an array 2024-07-09 22:58:10 +10:00
Madeline
35c9a09ea5
fix poll in msg create schema 2024-07-09 15:27:24 +10:00
TomatoCake
0ac8888d41 Don't embed links in <> 2024-07-04 09:41:46 +10:00
Madeline
095cbf7b20
Remove ALL fosscord mentions 2023-03-31 15:52:33 +11:00
Madeline
698ad90d3e
Revert "Merge pull request #1008 from spacebarchat/dev/samuel"
This reverts commit 69ea71aa9e0bd2e5a98904a66fba0ad3745707cb, reversing
changes made to 8b2faf0b18336e5dff1eeff4e849bcfd96b09e88.
2023-03-31 15:26:15 +11:00
Samuel (Flam3rboy)
69ea71aa9e
Merge pull request #1008 from spacebarchat/dev/samuel 2023-03-30 18:13:34 +02:00
Madeline
8b2faf0b18
SPACEBAR 2023-03-31 02:15:42 +11:00
Madeline
64e747a4d2
SPACEBAR 2023-03-31 02:05:02 +11:00
Samuel
7b00e99053 fix: use entity.save() instead of insert (needed for caching) 2023-03-18 04:13:04 +01:00
TheArcaneBrony
16f13616d2 Remove channel mentions from messages, in order to fix them in test client.
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
2023-02-20 05:09:57 +01:00
Madeline
084dc0be08 Add ESLint (#941)
* Add eslint, switch to lint-staged for precommit

* Fix all ESLint errors

* Update GH workflow to check prettier and eslint
2023-01-20 18:10:47 +11:00