| 1 |
package uiscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/ |
| 2 |
|
| 3 |
import ( |
| 4 |
"go.mau.fi/mauviewscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/" |
| •5 |
"github.com/gdamore/tcell/v2scip-go gomod github.com/golang/go/src go1.21 `github.com/gdamore/tcell/v2`/" |
| 6 |
|
| 7 |
"maunium.net/go/gomuks/configscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/config`/" |
| 8 |
) |
| 9 |
|
| 10 |
const helpTextscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/helpText. = `# General |
| 11 |
/help - Show this help dialog. |
| 12 |
/quit - Quit gomuks. |
| 13 |
/clearcache - Clear cache and quit gomuks. |
| 14 |
/logout - Log out of Matrix. |
| 15 |
/toggle <thing> - Temporary command to toggle various UI features. |
| 16 |
Run /toggle without arguments to see the list of toggles. |
| 17 |
|
| 18 |
# Media |
| 19 |
/download [path] - Downloads file from selected message. |
| 20 |
/open [path] - Download file from selected message and open it with xdg-open. |
| 21 |
/upload <path> - Upload the file at the given path to the current room. |
| 22 |
|
| 23 |
# Sending special messages |
| 24 |
/me <message> - Send an emote message. |
| 25 |
/notice <message> - Send a notice (generally used for bot messages). |
| 26 |
/rainbow <message> - Send rainbow text. |
| 27 |
/rainbowme <message> - Send rainbow text in an emote. |
| 28 |
/reply [text] - Reply to the selected message. |
| 29 |
/react <reaction> - React to the selected message. |
| 30 |
/redact [reason] - Redact the selected message. |
| 31 |
/edit - Edit the selected message. |
| 32 |
|
| 33 |
# Encryption |
| 34 |
/fingerprint - View the fingerprint of your device. |
| 35 |
|
| 36 |
/devices <user id> - View the device list of a user. |
| 37 |
/device <user id> <device id> - Show info about a specific device. |
| 38 |
/unverify <user id> <device id> - Un-verify a device. |
| 39 |
/blacklist <user id> <device id> - Blacklist a device. |
| 40 |
/verify <user id> - Verify a user with in-room verification. Probably broken. |
| 41 |
/verify-device <user id> <device id> [fingerprint] |
| 42 |
- Verify a device. If the fingerprint is not provided, |
| 43 |
interactive emoji verification will be started. |
| 44 |
/reset-session - Reset the outbound Megolm session in the current room. |
| 45 |
|
| 46 |
/import <file> - Import encryption keys |
| 47 |
/export <file> - Export encryption keys |
| 48 |
/export-room <file> - Export encryption keys for the current room. |
| 49 |
|
| 50 |
/cross-signing <subcommand> [...] |
| 51 |
- Cross-signing commands. Somewhat experimental. |
| 52 |
Run without arguments for help. (alias: /cs) |
| 53 |
/ssss <subcommand> [...] |
| 54 |
- Secure Secret Storage (and Sharing) commands. Very experimental. |
| 55 |
Run without arguments for help. |
| 56 |
|
| 57 |
# Rooms |
| 58 |
/pm <user id> <...> - Create a private chat with the given user(s). |
| 59 |
/create [room name] - Create a room. |
| 60 |
|
| 61 |
/join <room> [server] - Join a room. |
| 62 |
/accept - Accept the invite. |
| 63 |
/reject - Reject the invite. |
| 64 |
|
| 65 |
/invite <user id> - Invite the given user to the room. |
| 66 |
/roomnick <name> - Change your per-room displayname. |
| 67 |
/tag <tag> <priority> - Add the room to <tag>. |
| 68 |
/untag <tag> - Remove the room from <tag>. |
| 69 |
/tags - List the tags the room is in. |
| 70 |
/alias <act> <name> - Add or remove local addresses. |
| 71 |
|
| 72 |
/leave - Leave the current room. |
| 73 |
/kick <user id> [reason] - Kick a user. |
| 74 |
/ban <user id> [reason] - Ban a user. |
| 75 |
/unban <user id> - Unban a user.` |
| 76 |
|
| 77 |
type HelpModalscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal# struct { |
| 78 |
mauviewscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/.FocusableComponentscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#FocusableComponent. |
| 79 |
parentscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#parent. *MainViewscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/MainView# |
| 80 |
} |
| 81 |
|
| 82 |
func NewHelpModalscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/NewHelpModal().(parent *MainViewscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/MainView#) *HelpModalscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal# { |
| 83 |
hm := &HelpModalscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#{parentscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#parent.: parent} |
| 84 |
|
| 85 |
text := mauviewscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/.NewTextViewscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/NewTextView().(). |
| 86 |
SetTextscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/TextView#SetText().(helpTextscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/helpText.). |
| 87 |
SetScrollablescip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/TextView#SetScrollable().(true). |
| 88 |
SetWrapscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/TextView#SetWrap().(false). |
| 89 |
SetTextColorscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/TextView#SetTextColor().(tcell.ColorDefault) |
| 90 |
|
| 91 |
box := mauviewscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/.NewBoxscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/NewBox().(text). |
| 92 |
SetBorderscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/Box#SetBorder().(true). |
| 93 |
SetTitlescip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/Box#SetTitle().("Help"). |
| 94 |
SetBlurCaptureFuncscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/Box#SetBlurCaptureFunc().(func() bool { |
| 95 |
hm.parentscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#parent..HideModalscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/MainView#HideModal().() |
| 96 |
return true |
| 97 |
}) |
| 98 |
box.Focusscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/Box#Focus().() |
| 99 |
|
| 100 |
hm.FocusableComponentscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#FocusableComponent. = mauviewscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/.FractionalCenterscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/FractionalCenter().(box, 42, 10, 0.5, 0.5) |
| 101 |
|
| 102 |
return hm |
| 103 |
} |
| 104 |
|
| 105 |
func (hm *HelpModalscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#) OnKeyEventscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#OnKeyEvent().(event mauviewscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/.KeyEventscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/KeyEvent#) bool { |
| 106 |
kb := configscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/config`/.Keybindscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/config`/Keybind#{ |
| 107 |
Keyscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/config`/Keybind#Key.: event.Keyscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/KeyEvent#Key().(), |
| 108 |
Chscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/config`/Keybind#Ch.: event.Runescip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/KeyEvent#Rune().(), |
| 109 |
Modscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/config`/Keybind#Mod.: event.Modifiersscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/KeyEvent#Modifiers().(), |
| 110 |
} |
| 111 |
// TODO unhardcode q |
| 112 |
if hm.parentscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#parent..configscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/MainView#config..Keybindingsscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/config`/Config#Keybindings..Modalscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/config`/ParsedKeybindings#Modal.[kb] == "cancel" || event.Runescip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/KeyEvent#Rune().() == 'q' { |
| 113 |
hm.parentscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#parent..HideModalscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/MainView#HideModal().() |
| 114 |
return true |
| 115 |
} |
| 116 |
return hm.FocusableComponentscip-go gomod maunium.net/go/gomuks . `maunium.net/go/gomuks/ui`/HelpModal#FocusableComponent..OnKeyEventscip-go gomod go.mau.fi/mauview v0.2.1 `go.mau.fi/mauview`/Component#OnKeyEvent().(event) |
| 117 |
} |