diff --git a/src/controllers/FikaDialogueController.ts b/src/controllers/FikaDialogueController.ts index 80c70f35..7b2954f0 100644 --- a/src/controllers/FikaDialogueController.ts +++ b/src/controllers/FikaDialogueController.ts @@ -75,13 +75,14 @@ export class FikaDialogueController { } public sendMessage(sessionID: string, request: ISendMessageRequest): string { - const receiverProfile = this.saveServer.getProfile(request.dialogId); - if (!receiverProfile) { - // if it's not to another player let Aki handle it + const profiles = this.saveServer.getProfiles(); + if (!(sessionID in profiles) || !(request.dialogId in profiles)) { + // if it's not to another player let SPT handle it return DialogueController.prototype.sendMessage.call(this.dialogController, sessionID, request); } - const senderProfile = this.saveServer.getProfile(sessionID); + const receiverProfile = profiles[request.dialogId]; + const senderProfile = profiles[sessionID]; if (!(request.dialogId in senderProfile.dialogues)) { senderProfile.dialogues[request.dialogId] = { attachmentsNew: 0, @@ -271,4 +272,4 @@ export class FikaDialogueController { public unIgnoreFriend(fromId: string, friendId: string): void { this.fikaPlayerRelationsHelper.removeFromIgnoreList(fromId, friendId); } -} +} \ No newline at end of file