aboutsummaryrefslogtreecommitdiff
path: root/ui/room-view.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-04-10 01:42:27 +0300
committerTulir Asokan <tulir@maunium.net>2019-04-10 01:42:27 +0300
commit06c306bee91ce2b7e7b5f32fad7c3f8b5b38d883 (patch)
treec5deabd2e86e3a40d86a7173a1a49c874ad99690 /ui/room-view.go
parentbbde1219479bb257c7bc1f9546bd67e8a151198c (diff)
Fix date change messages and input submit handling
Diffstat (limited to 'ui/room-view.go')
-rw-r--r--ui/room-view.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/ui/room-view.go b/ui/room-view.go
index e37760e..4402eaa 100644
--- a/ui/room-view.go
+++ b/ui/room-view.go
@@ -57,8 +57,6 @@ type RoomView struct {
ulBorderScreen *mauview.ProxyScreen
ulScreen *mauview.ProxyScreen
- inputSubmitFunc func(room *RoomView, text string)
-
prevScreen mauview.Screen
parent *MainView
@@ -118,11 +116,6 @@ func (view *RoomView) logPath(dir string) string {
return filepath.Join(dir, fmt.Sprintf("%s.gmxlog", view.Room.ID))
}
-func (view *RoomView) SetInputSubmitFunc(fn func(room *RoomView, text string)) *RoomView {
- view.inputSubmitFunc = fn
- return view
-}
-
func (view *RoomView) SetInputChangedFunc(fn func(room *RoomView, text string)) *RoomView {
view.input.SetChangedFunc(func(text string) {
fn(view, text)
@@ -250,8 +243,8 @@ func (view *RoomView) OnKeyEvent(event mauview.KeyEvent) bool {
msgView.AddScrollOffset(-msgView.Height() / 2)
return true
case tcell.KeyEnter:
- if event.Modifiers()&tcell.ModShift == 0 && event.Modifiers()&tcell.ModCtrl == 0 && view.inputSubmitFunc != nil {
- view.inputSubmitFunc(view, view.input.GetText())
+ if event.Modifiers()&tcell.ModShift == 0 && event.Modifiers()&tcell.ModCtrl == 0 {
+ view.InputSubmit(view.input.GetText())
return true
}
}