mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-21 10:12:00 -08:00
Soulseek: implement user actions
This commit is contained in:
parent
e36a15c706
commit
9f24a1e54f
@ -42,6 +42,11 @@ func (b *Bsoulseek) handleChatMessage(msg sayChatroomMessageReceive) {
|
||||
Channel: msg.Room,
|
||||
Username: msg.Username,
|
||||
}
|
||||
if strings.HasPrefix(msg.Message, "/me ") {
|
||||
// user action
|
||||
bridgeMessage.Text = msg.Message[4:]
|
||||
bridgeMessage.Event = config.EventUserAction
|
||||
}
|
||||
b.local <- bridgeMessage
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,11 @@ func (b *Bsoulseek) Send(msg config.Message) (string, error) {
|
||||
if msg.Event != "" && msg.Event != config.EventUserAction && msg.Event != config.EventJoinLeave {
|
||||
return "", nil
|
||||
}
|
||||
b.messagesToSend <- makeSayChatroomMessage(msg.Channel, msg.Username+msg.Text)
|
||||
text := msg.Username+msg.Text
|
||||
if msg.Event == config.EventUserAction {
|
||||
text = msg.Username + "/me " + msg.Text
|
||||
}
|
||||
b.messagesToSend <- makeSayChatroomMessage(msg.Channel, text)
|
||||
return "", nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user