Skip to content

Commit 665ff31

Browse files
committed
Message from plugin can be executed as commands.
1 parent f24b471 commit 665ff31

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

rpc.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,13 @@ func (s *pluginServer) SendMessage(ctx context.Context, msg *pb.Message) (*pb.Me
226226
var localMsg Message
227227
if msg.GetFrom() == "" {
228228
localMsg = NewNoSenderMessage(msg.Msg)
229+
localMsg = localMsg.dontSendToPlugin(token)
230+
r.broadcast(localMsg)
229231
} else {
230232
localMsg = NewFakeUserMessage(msg.GetFrom(), msg.Msg, r)
233+
localMsg = localMsg.dontSendToPlugin(token)
234+
runCommands(localMsg)
231235
}
232-
localMsg = localMsg.dontSendToPlugin(token)
233-
r.broadcast(localMsg)
234236
}
235237
return &pb.MessageRes{}, nil
236238
}

0 commit comments

Comments
 (0)