fix a WRITE_PRIVATE_MESSAGE rpc regression

This commit is contained in:
ansuz
2020-02-03 15:47:41 -05:00
parent 4e71b63331
commit 6523974ca2
3 changed files with 42 additions and 43 deletions

View File

@@ -180,9 +180,9 @@ Channel.writePrivateMessage = function (Env, args, Server, cb) {
msg // the actual message content. Generally a string
];
// XXX this API doesn't exist anymore...
// store the message and do everything else that is typically done when going through historyKeeper
Env.historyKeeper.onChannelMessage(Server, channelStruct, fullMessage);
// historyKeeper already knows how to handle metadata and message validation, so we just pass it off here
// if the message isn't valid it won't be stored.
Env.historyKeeper.channelMessage(Server, channelStruct, fullMessage);
// call back with the message and the target channel.
// historyKeeper will take care of broadcasting it if anyone is in the channel