Skip to content

Commit

Permalink
fix: making direction not readonly and set outgoing messages with cor…
Browse files Browse the repository at this point in the history
…rect direction.
  • Loading branch information
elribonazo committed Apr 16, 2024
1 parent 072f86a commit 11fd18d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/domain/models/Message.ts
Expand Up @@ -36,10 +36,10 @@ export class Message implements Pluto.Storable {
1 * 24 * 60 * 60
).toString(),
public readonly ack: string[] = [],
public readonly direction: MessageDirection = MessageDirection.RECEIVED,
public direction: MessageDirection = MessageDirection.RECEIVED,
public readonly fromPrior?: string,
public readonly pthid?: string
) {}
) { }

static fromJson(jsonString: JsonString): Message {
const messageObj = JSON.parse(jsonString);
Expand Down
1 change: 1 addition & 0 deletions src/prism-agent/connectionsManager/ConnectionsManager.ts
Expand Up @@ -247,6 +247,7 @@ export class ConnectionsManager implements ConnectionsManagerClass {
* @returns {Promise<Message | undefined>}
*/
async sendMessage(message: Message): Promise<Message | undefined> {
message.direction = MessageDirection.SENT;
await this.pluto.storeMessage(message);
return this.mercury.sendMessageParseMessage(message);
}
Expand Down

0 comments on commit 11fd18d

Please sign in to comment.