mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-11 04:33:02 +02:00
Map Discord member permissions to sim user PLs
Including PL 20 for members who can mention everyone.
This commit is contained in:
parent
bf3d219716
commit
043f178d1e
3 changed files with 76 additions and 19 deletions
|
@ -131,7 +131,7 @@ async function syncUser(author, pkMessage, roomID) {
|
|||
db.prepare("INSERT OR IGNORE INTO sim_proxy (user_id, proxy_owner_id, displayname) VALUES (?, ?, ?)").run(pkMessage.member.uuid, pkMessage.sender, author.username)
|
||||
// Sync the member state
|
||||
const content = await memberToStateContent(pkMessage, author)
|
||||
const currentHash = registerUser._hashProfileContent(content)
|
||||
const currentHash = registerUser._hashProfileContent(content, 0)
|
||||
const existingHash = select("sim_member", "hashed_profile_content", {room_id: roomID, mxid}).safeIntegers().pluck().get()
|
||||
// only do the actual sync if the hash has changed since we last looked
|
||||
if (existingHash !== currentHash) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue