Fix style with gofmt

This commit is contained in:
Digital 2018-06-30 22:13:17 +02:00
parent b5b7f8e24f
commit 7088106ce1
3 changed files with 18 additions and 18 deletions

View file

@ -37,11 +37,11 @@ type AuthCache struct {
}
type UserPreferences struct {
HideUserList bool `yaml:"hide_user_list"`
HideRoomList bool `yaml:"hide_room_list"`
BareMessageView bool `yaml:"bare_message_view"`
DisableImages bool `yaml:"disable_images"`
DisableTypingNotifs bool `yaml:"disable_typing_notifs"`
HideUserList bool `yaml:"hide_user_list"`
HideRoomList bool `yaml:"hide_room_list"`
BareMessageView bool `yaml:"bare_message_view"`
DisableImages bool `yaml:"disable_images"`
DisableTypingNotifs bool `yaml:"disable_typing_notifs"`
}
// Config contains the main config of gomuks.

View file

@ -18,10 +18,10 @@ package ui
import (
"encoding/json"
"maunium.net/go/gomuks/debug"
"strings"
"fmt"
"github.com/lucasb-eyer/go-colorful"
"maunium.net/go/gomuks/debug"
"strings"
"unicode"
)
@ -74,7 +74,7 @@ func cmdRainbow(cmd *Command) {
html.WriteRune(char)
continue
}
color := rainbow.GetInterpolatedColorFor(float64(i)/float64(len(text))).Hex()
color := rainbow.GetInterpolatedColorFor(float64(i) / float64(len(text))).Hex()
fmt.Fprintf(&html, "<font color=\"%s\">%c</font>", color, char)
}
tempMessage := cmd.Room.NewTempMessage("m.text", html.String())
@ -199,11 +199,11 @@ func cmdToggle(cmd *Command) {
case "typingnotif":
cmd.Config.Preferences.DisableTypingNotifs = !cmd.Config.Preferences.DisableTypingNotifs
default:
cmd.Reply("Usage: /toggle <rooms/users/baremessages/images/typingnotif>")
cmd.Reply("Usage: /toggle <rooms/users/baremessages/images/typingnotif>")
return
}
// is there a reason this is called twice?
// cmd.UI.Render()
// is there a reason this is called twice?
// cmd.UI.Render()
cmd.UI.Render()
go cmd.Matrix.SendPreferencesToMatrix()
}

View file

@ -102,13 +102,13 @@ func (view *MainView) MarkRead(roomView *RoomView) {
}
func (view *MainView) InputChanged(roomView *RoomView, text string) {
if !roomView.config.Preferences.DisableTypingNotifs {
if len(text) == 0 {
go view.matrix.SendTyping(roomView.Room.ID, false)
} else if text[0] != '/' {
go view.matrix.SendTyping(roomView.Room.ID, true)
}
}
if !roomView.config.Preferences.DisableTypingNotifs {
if len(text) == 0 {
go view.matrix.SendTyping(roomView.Room.ID, false)
} else if text[0] != '/' {
go view.matrix.SendTyping(roomView.Room.ID, true)
}
}
}
func findWordToTabComplete(text string) string {