Synchronize selected user access
This commit is contained in:
committed by
Brandon McGinty
parent
20c6997ab0
commit
3efbd019ce
@@ -57,7 +57,7 @@ func (b *Barnard) Notify(event string, who string, what string) {
|
||||
}
|
||||
|
||||
func (b *Barnard) SetSelectedUser(user *gumble.User) {
|
||||
b.selectedUser = user
|
||||
b.setSelectedUserValue(user)
|
||||
if user == nil {
|
||||
if len(b.UiInput.Text) > 0 {
|
||||
}
|
||||
@@ -493,9 +493,9 @@ func (b *Barnard) OnTextInput(ui *uiterm.Ui, textbox *uiterm.Textbox, text strin
|
||||
|
||||
// Not a command, send as chat message
|
||||
if b.Client != nil && b.Client.Self != nil {
|
||||
if b.selectedUser != nil {
|
||||
b.selectedUser.Send(text)
|
||||
b.AddOutputPrivateMessage(b.Client.Self, b.selectedUser, text)
|
||||
if selectedUser := b.selectedUserValue(); selectedUser != nil {
|
||||
selectedUser.Send(text)
|
||||
b.AddOutputPrivateMessage(b.Client.Self, selectedUser, text)
|
||||
} else {
|
||||
b.Client.Self.Channel.Send(text, false)
|
||||
b.AddOutputMessage(b.Client.Self, text)
|
||||
|
||||
Reference in New Issue
Block a user