Merge branch 'master' into update
This commit is contained in:
commit
7651e84be9
34
README.md
34
README.md
@ -25,6 +25,20 @@ or compile from source:
|
|||||||
1. Run `go get -u maunium.net/go/gomuks`
|
1. Run `go get -u maunium.net/go/gomuks`
|
||||||
2. gomuks should now be in `$GOPATH/bin/gomuks`
|
2. gomuks should now be in `$GOPATH/bin/gomuks`
|
||||||
|
|
||||||
|
## Developing
|
||||||
|
Running `go install` in `$GOPATH/src/maunium.net/go/gomuks` will recompile the project and dependencies into `$GOPATH/bin/gomuks`.
|
||||||
|
|
||||||
|
For debugging, use `tail -f /tmp/gomuks-debug.log` and write to it using the methods in the `maunium.net/go/gomuks/debug` package:
|
||||||
|
```go
|
||||||
|
import (
|
||||||
|
"maunium.net/go/gomuks/debug"
|
||||||
|
)
|
||||||
|
...
|
||||||
|
func Foo() {
|
||||||
|
debug.Print("WHY ISN'T IT WORKING?!?!?")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
- switch rooms - `Ctrl + ↑` `Ctrl + ↓` `Alt + ↑` `Alt + ↓`
|
- switch rooms - `Ctrl + ↑` `Ctrl + ↓` `Alt + ↑` `Alt + ↓`
|
||||||
- scroll chat (line) - `↑` `↓`
|
- scroll chat (line) - `↑` `↓`
|
||||||
@ -32,13 +46,13 @@ or compile from source:
|
|||||||
- jump to room - `Alt + Enter`, then `Tab` and `Enter` to navigate and select room
|
- jump to room - `Alt + Enter`, then `Tab` and `Enter` to navigate and select room
|
||||||
|
|
||||||
### Commands
|
### Commands
|
||||||
* `help` - Is a known command
|
* `/help` - Is a known command
|
||||||
* `me <text>` - Send an emote
|
* `/me <text>` - Send an emote
|
||||||
* `quit` - Close gomuks
|
* `/quit` - Close gomuks
|
||||||
* `clearcache` - Clear room state and close gomuks
|
* `/clearcache` - Clear room state and close gomuks
|
||||||
* `leave` - Leave the current room
|
* `/leave` - Leave the current room
|
||||||
* `join <room>` - Join the room with the given room ID or alias
|
* `/join <room>` - Join the room with the given room ID or alias
|
||||||
* `toggle <rooms/users/baremessages/images/typingnotif>` - Change user preferences
|
* `/toggle <rooms/users/baremessages/images/typingnotif>` - Change user preferences
|
||||||
* `logout` - Log out, clear caches and go back to the login view
|
* `/logout` - Log out, clear caches and go back to the login view
|
||||||
* `send <room id> <event type> <content>` - Send a custom event
|
* `/send <room id> <event type> <content>` - Send a custom event
|
||||||
* `setstate <room id> <event type> <state key/`-`> <content>` - Change room state
|
* `/setstate <room id> <event type> <state key/-> <content>` - Change room state
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"maunium.net/go/gomuks/debug"
|
"maunium.net/go/gomuks/debug"
|
||||||
"maunium.net/go/gomuks/matrix/rooms"
|
"maunium.net/go/gomuks/matrix/rooms"
|
||||||
"maunium.net/go/tcell"
|
"maunium.net/go/tcell"
|
||||||
@ -313,6 +314,27 @@ func (list *RoomList) Next() (string, *rooms.Room) {
|
|||||||
return list.Last()
|
return list.Last()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NextWithActivity Returns next room with activity.
|
||||||
|
//
|
||||||
|
// Sorted by (in priority):
|
||||||
|
//
|
||||||
|
// - Highlights
|
||||||
|
// - Messages
|
||||||
|
// - Other traffic (joins, parts, etc)
|
||||||
|
//
|
||||||
|
// TODO: Sorting. Now just finds first room with new messages.
|
||||||
|
func (list *RoomList) NextWithActivity() (string, *rooms.Room) {
|
||||||
|
for tag, trl := range list.items {
|
||||||
|
for _, room := range trl.All() {
|
||||||
|
if room.HasNewMessages() {
|
||||||
|
return tag, room.Room
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// No room with activity found
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
func (list *RoomList) index(tag string, room *rooms.Room) int {
|
func (list *RoomList) index(tag string, room *rooms.Room) int {
|
||||||
tagIndex := list.IndexTag(tag)
|
tagIndex := list.IndexTag(tag)
|
||||||
if tagIndex == -1 {
|
if tagIndex == -1 {
|
||||||
|
@ -18,12 +18,13 @@ package ui
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"maunium.net/go/gomuks/matrix/rooms"
|
"maunium.net/go/gomuks/matrix/rooms"
|
||||||
"maunium.net/go/gomuks/ui/widget"
|
"maunium.net/go/gomuks/ui/widget"
|
||||||
"maunium.net/go/tcell"
|
"maunium.net/go/tcell"
|
||||||
"maunium.net/go/tview"
|
"maunium.net/go/tview"
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type OrderedRoom struct {
|
type OrderedRoom struct {
|
||||||
|
@ -196,6 +196,8 @@ func (view *MainView) KeyEventHandler(roomView *RoomView, key *tcell.EventKey) *
|
|||||||
searchModal := NewFuzzySearchModal(view, 42, 12)
|
searchModal := NewFuzzySearchModal(view, 42, 12)
|
||||||
view.parent.views.AddPage("fuzzy-search-modal", searchModal, true, true)
|
view.parent.views.AddPage("fuzzy-search-modal", searchModal, true, true)
|
||||||
view.parent.app.SetFocus(searchModal)
|
view.parent.app.SetFocus(searchModal)
|
||||||
|
case c == 'a':
|
||||||
|
view.SwitchRoom(view.roomList.NextWithActivity())
|
||||||
case c == 'l':
|
case c == 'l':
|
||||||
view.ShowBare(roomView)
|
view.ShowBare(roomView)
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user