Use _uid instead of _id to please Rails
This commit is contained in:
parent
87bb05fdd5
commit
ac42d7df78
22 changed files with 151 additions and 50 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@link-stack/bridge-worker",
|
||||
"version": "3.4.0-beta.5",
|
||||
"version": "3.4.0-beta.6",
|
||||
"type": "module",
|
||||
"main": "build/main/index.js",
|
||||
"author": "Darren Clarke <darren@redaranj.com>",
|
||||
|
|
|
|||
|
|
@ -64,13 +64,14 @@ const sendSignalMessageTask = async ({
|
|||
let groupCreated = false;
|
||||
|
||||
try {
|
||||
// Check if 'to' is a group ID (UUID format, group.base64 format, or base64) vs phone number
|
||||
const isUUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
||||
to,
|
||||
);
|
||||
// Check if 'to' is a group ID (group.base64 format or base64 internal ID) vs individual recipient
|
||||
// Signal group IDs are 32 bytes = 44 chars base64 (or 43 without padding)
|
||||
// Signal user UUIDs (ACIs) are 36 chars with hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
// Phone numbers start with +, usernames with u:, PNIs with PNI:
|
||||
const isGroupPrefix = to.startsWith("group.");
|
||||
const isBase64 = /^[A-Za-z0-9+/]+=*$/.test(to) && to.length > 20; // Base64 internal_id
|
||||
const isGroupId = isUUID || isGroupPrefix || isBase64;
|
||||
const isBase64GroupId =
|
||||
/^[A-Za-z0-9+/]+=*$/.test(to) && to.length >= 43 && to.length <= 44;
|
||||
const isGroupId = isGroupPrefix || isBase64GroupId;
|
||||
const enableAutoGroups = process.env.BRIDGE_SIGNAL_AUTO_GROUPS === "true";
|
||||
|
||||
logger.debug(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue