mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
Punch webhook name through to bridge
This commit is contained in:
parent
87b4c98509
commit
ba51f0db1b
@ -12,6 +12,7 @@ import { HookshotGithubBridge } from "../../bridges/HookshotGithubBridge";
|
||||
import { HookshotWebhookBridge } from "../../bridges/HookshotWebhookBridge";
|
||||
|
||||
interface BridgeRoomRequest {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -31,7 +32,7 @@ export class DimensionHookshotWebhookService {
|
||||
|
||||
try {
|
||||
const hookshot = new HookshotWebhookBridge(userId);
|
||||
return hookshot.newConnection(roomId);
|
||||
return hookshot.newConnection(roomId, request.name);
|
||||
} catch (e) {
|
||||
LogService.error("DimensionHookshotWebhookService", e);
|
||||
throw new ApiError(400, "Error bridging room");
|
||||
|
@ -34,10 +34,11 @@ export class HookshotWebhookBridge extends HookshotBridge {
|
||||
return (await this.getAllRoomConfigurations(inRoomId)).filter(c => c.eventType === HookshotTypes.Webhook);
|
||||
}
|
||||
|
||||
public async newConnection(roomId: string): Promise<HookshotWebhookRoomConfig> {
|
||||
public async newConnection(roomId: string, name: string): Promise<HookshotWebhookRoomConfig> {
|
||||
const bridge = await this.getDefaultBridge();
|
||||
|
||||
const body = {
|
||||
name,
|
||||
};
|
||||
return await this.doProvisionRequest<HookshotWebhookRoomConfig>(bridge, "PUT", `/v1/${roomId}/connections/${HookshotTypes.Webhook}`, null, body);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ export interface FE_HookshotWebhookBridge {
|
||||
export interface FE_HookshotWebhookConnection {
|
||||
id: string;
|
||||
config: {
|
||||
name?: string; // TODO: Update according to bridge support
|
||||
name?: string;
|
||||
url: string;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user