mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
Parse upstream travis-ci configurations correctly
This commit is contained in:
parent
ff088e3e49
commit
bd03db7674
@ -20,6 +20,7 @@ interface InternalTravisCiConfig {
|
|||||||
[roomId: string]: {
|
[roomId: string]: {
|
||||||
[repoKey: string]: {
|
[repoKey: string]: {
|
||||||
template: string;
|
template: string;
|
||||||
|
addedByUserId: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -90,9 +91,14 @@ export class NebProxy {
|
|||||||
|
|
||||||
if (!result) result = {};
|
if (!result) result = {};
|
||||||
if (integration.type === "travisci") {
|
if (integration.type === "travisci") {
|
||||||
// Replace the webhook ID with the requesting user's webhook ID (generating it if needed)
|
let repos = result.rooms ? result.rooms[inRoomId] : {};
|
||||||
result["webhookId"] = await this.getWebhookId(integration.type);
|
if (!repos) repos = {};
|
||||||
delete result["webhook_url"];
|
|
||||||
|
// Replace the entire result to better represent how this should be sent
|
||||||
|
result = <TravisCiConfiguration>{
|
||||||
|
webhookId: await this.getWebhookId("travisci"),
|
||||||
|
repos: repos,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -160,6 +166,7 @@ export class NebProxy {
|
|||||||
for (const repoKey of repoKeys) {
|
for (const repoKey of repoKeys) {
|
||||||
result.rooms[roomId][repoKey] = {
|
result.rooms[roomId][repoKey] = {
|
||||||
template: integration.config.rooms[roomId].repos[repoKey].template,
|
template: integration.config.rooms[roomId].repos[repoKey].template,
|
||||||
|
addedByUserId: userId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user