Skip to content

Commit dceff19

Browse files
committed
remove post message handlers
1 parent fb5eaa2 commit dceff19

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

github/GithubApp.ts

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,19 @@ import { IJobContext, StartupType } from "@rocket.chat/apps-engine/definition/sc
4848
import { IRoom } from "@rocket.chat/apps-engine/definition/rooms";
4949
import { clearInteractionRoomData, getInteractionRoomData } from "./persistance/roomInteraction";
5050
import { GHCommand } from "./commands/GhCommand";
51-
import { IPreMessageSentExtend, IMessage,IPreMessageSentModify, IPostMessageSent } from "@rocket.chat/apps-engine/definition/messages";
51+
import { IPreMessageSentExtend, IMessage } from "@rocket.chat/apps-engine/definition/messages";
5252
import { handleGitHubCodeSegmentLink } from "./handlers/GitHubCodeSegmentHandler";
5353
import { isGithubLink, hasGitHubCodeSegmentLink, hasGithubPRLink } from "./helpers/checkLinks";
5454
import { SendReminder } from "./handlers/SendReminder";
5555
import { AppSettings, settings } from "./settings/settings";
56-
import { ISetting } from "@rocket.chat/apps-engine/definition/settings";import { handleGithubPRLink } from "./handlers/GithubPRlinkHandler";
56+
import { ISetting } from "@rocket.chat/apps-engine/definition/settings";
57+
import { handleGithubPRLinks } from "./handlers/GithubPRlinkHandler";
5758

58-
export class GithubApp extends App implements IPreMessageSentExtend,IPostMessageSent{
59+
export class GithubApp extends App implements IPreMessageSentExtend {
5960
constructor(info: IAppInfo, logger: ILogger, accessors: IAppAccessors) {
6061
super(info, logger, accessors);
6162
}
6263

63-
async checkPostMessageSent?(message: IMessage, read: IRead, http: IHttp): Promise<boolean> {
64-
if (await hasGithubPRLink(message)){
65-
return true
66-
}
67-
return false;
68-
}
69-
70-
async executePostMessageSent(message: IMessage, read: IRead, http: IHttp, persistence: IPersistence, modify: IModify): Promise<void> {
71-
72-
await handleGithubPRLink(message,read,http,persistence,modify)
73-
74-
}
75-
7664
public async checkPreMessageSentExtend(
7765
message: IMessage,
7866
read: IRead,
@@ -95,7 +83,11 @@ export class GithubApp extends App implements IPreMessageSentExtend,IPostMessage
9583
if (await hasGitHubCodeSegmentLink(message)) {
9684
await handleGitHubCodeSegmentLink(message, read, http, message.sender, message.room, extend);
9785
}
98-
86+
if (await hasGithubPRLink(message)) {
87+
console.log("test")
88+
await handleGithubPRLinks(message, read, http, message.sender, message.room, extend)
89+
}
90+
9991
return extend.getMessage();
10092
}
10193

github/app.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"classFile": "GithubApp.ts",
1414
"description": "The ultimate app extending Rocket.Chat for all developers collaborating on Github",
1515
"implements": [
16-
"IPreMessageSentExtend",
17-
"IPostMessageSent"
16+
"IPreMessageSentExtend"
1817
]
1918
}

0 commit comments

Comments
 (0)