Compare commits
1 commit
789c7b0334
...
a55d7a1632
| Author | SHA1 | Date | |
|---|---|---|---|
| a55d7a1632 |
4 changed files with 14 additions and 3 deletions
9
jsconfig.json
Normal file
9
jsconfig.json
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2024",
|
||||||
|
"module": "nodenext",
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"useUnknownInCatchVariables": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -207,6 +207,7 @@ async function attachmentToEvent(mentions, attachment) {
|
||||||
* - alwaysReturnFormattedBody: false - formatted_body will be skipped if it is the same as body because the message is plaintext. if you want the formatted_body to be returned anyway, for example to merge it with another message, then set this to true.
|
* - alwaysReturnFormattedBody: false - formatted_body will be skipped if it is the same as body because the message is plaintext. if you want the formatted_body to be returned anyway, for example to merge it with another message, then set this to true.
|
||||||
* - scanTextForMentions: true - needs to be set to false when converting forwarded messages etc which may be from a different channel that can't be scanned.
|
* - scanTextForMentions: true - needs to be set to false when converting forwarded messages etc which may be from a different channel that can't be scanned.
|
||||||
* @param {{api: import("../../matrix/api"), snow?: import("snowtransfer").SnowTransfer}} di simple-as-nails dependency injection for the matrix API
|
* @param {{api: import("../../matrix/api"), snow?: import("snowtransfer").SnowTransfer}} di simple-as-nails dependency injection for the matrix API
|
||||||
|
* @returns {Promise<{$type: string, $sender?: string, [x: string]: any}[]>}
|
||||||
*/
|
*/
|
||||||
async function messageToEvent(message, guild, options = {}, di) {
|
async function messageToEvent(message, guild, options = {}, di) {
|
||||||
const events = []
|
const events = []
|
||||||
|
|
|
||||||
4
src/types.d.ts
vendored
4
src/types.d.ts
vendored
|
|
@ -149,7 +149,7 @@ export namespace Event {
|
||||||
prev_content?: any
|
prev_content?: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Outer_StrippedChildStateEvent = {
|
export type StrippedChildStateEvent = {
|
||||||
type: string
|
type: string
|
||||||
state_key: string
|
state_key: string
|
||||||
sender: string
|
sender: string
|
||||||
|
|
@ -353,7 +353,7 @@ export namespace R {
|
||||||
export type Hierarchy = {
|
export type Hierarchy = {
|
||||||
avatar_url?: string
|
avatar_url?: string
|
||||||
canonical_alias?: string
|
canonical_alias?: string
|
||||||
children_state: Event.Outer_StrippedChildStateEvent[]
|
children_state: Event.StrippedChildStateEvent[]
|
||||||
guest_can_join: boolean
|
guest_can_join: boolean
|
||||||
join_rule?: string
|
join_rule?: string
|
||||||
name?: string
|
name?: string
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,8 @@ as.router.post("/api/link-space", defineEventHandler(async event => {
|
||||||
if (existing) throw createError({status: 400, message: "Bad Request", data: `Guild ID ${guildID} or space ID ${spaceID} are already bridged and cannot be reused`})
|
if (existing) throw createError({status: 400, message: "Bad Request", data: `Guild ID ${guildID} or space ID ${spaceID} are already bridged and cannot be reused`})
|
||||||
|
|
||||||
const inviteSender = select("invite", "mxid", {mxid: session.data.mxid, room_id: spaceID}).pluck().get()
|
const inviteSender = select("invite", "mxid", {mxid: session.data.mxid, room_id: spaceID}).pluck().get()
|
||||||
const via = [ inviteSender?.match(/:(.*)/)?.[1] ?? "" ]
|
const inviteSenderServer = inviteSender?.match(/:(.*)/)?.[1]
|
||||||
|
const via = [inviteSenderServer || ""]
|
||||||
|
|
||||||
// Check space exists and bridge is joined
|
// Check space exists and bridge is joined
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue