mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
more timeout mess aroundary
This commit is contained in:
1 parent
9cccf91a84
commit
8191a9431c
5 files changed
+28
-23
No files matched your search
@@ -180,17 +180,6 @@ async function checkIfMessageGroupExists(groupId: string): Promise<boolean> {
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
async function getParticipantsByGroup(groupId: string): Promise<string[]> {
|
||||
const query = `
|
||||
SELECT participant_identifier as identifier
|
||||
FROM npwd_messages_groups
|
||||
WHERE group_id = ?;
|
||||
`;
|
||||
const [results] = await pool.query(query, [ groupId]);
|
||||
const rows = (<any>results);
|
||||
return rows.map((row: any) => row.identifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Consolidate raw message groups into a mapping that groups participants
|
||||
* by the message group. The goal of this is to reduce the rows of message
|
||||
@@ -267,6 +256,11 @@ async function createMessageGroupsFromPhoneNumbers(
|
||||
}
|
||||
}
|
||||
|
||||
// don't allow explicitly adding yourself
|
||||
if (identifiers.some(identifier => identifier === userIdentifier)) {
|
||||
return { error: true, mine: true };
|
||||
}
|
||||
|
||||
// make sure we are always in a consistent order. It is very important
|
||||
// that this not change! Changing this order can result in the ability
|
||||
// of duplicate message groups being created.
|
||||
|
||||
Reference in new issue
Block a user