@@ -18,8 +18,8 @@ import (
18
18
19
19
const maxInputLength int = 1024
20
20
21
- // GetPrompt will render the terminal prompt string based on the user.
22
- func GetPrompt (user * message.User ) string {
21
+ // getPrompt will render the terminal prompt string based on the user.
22
+ func getPrompt (user * message.User ) string {
23
23
name := user .Name ()
24
24
cfg := user .Config ()
25
25
if cfg .Theme != nil {
@@ -90,8 +90,8 @@ func (h *Host) isOp(conn sshd.Connection) bool {
90
90
91
91
// Connect a specific Terminal to this host and its room.
92
92
func (h * Host ) Connect (term * sshd.Terminal ) {
93
- id := NewIdentity (term .Conn )
94
- user := message .NewUserScreen (id , term )
93
+ ident := toIdentity (term .Conn )
94
+ user := message .NewUserScreen (ident , term )
95
95
cfg := user .Config ()
96
96
cfg .Theme = & h .theme
97
97
user .SetConfig (cfg )
@@ -115,7 +115,7 @@ func (h *Host) Connect(term *sshd.Terminal) {
115
115
member , err := h .Join (user )
116
116
if err != nil {
117
117
// Try again...
118
- id .SetName (fmt .Sprintf ("Guest%d" , count ))
118
+ ident .SetName (fmt .Sprintf ("Guest%d" , count ))
119
119
member , err = h .Join (user )
120
120
}
121
121
if err != nil {
@@ -124,7 +124,7 @@ func (h *Host) Connect(term *sshd.Terminal) {
124
124
}
125
125
126
126
// Successfully joined.
127
- term .SetPrompt (GetPrompt (user ))
127
+ term .SetPrompt (getPrompt (user ))
128
128
term .AutoCompleteCallback = h .AutoCompleteFunction (user )
129
129
user .SetHighlight (user .Name ())
130
130
@@ -172,7 +172,7 @@ func (h *Host) Connect(term *sshd.Terminal) {
172
172
//
173
173
// FIXME: This is hacky, how do we improve the API to allow for
174
174
// this? Chat module shouldn't know about terminals.
175
- term .SetPrompt (GetPrompt (user ))
175
+ term .SetPrompt (getPrompt (user ))
176
176
user .SetHighlight (user .Name ())
177
177
}
178
178
}
@@ -344,7 +344,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
344
344
return errors .New ("user not found" )
345
345
}
346
346
347
- id := target .Identifier .(* Identity )
347
+ id := target .Identifier .(* identity )
348
348
var whois string
349
349
switch room .IsOp (msg .From ()) {
350
350
case true :
@@ -430,7 +430,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
430
430
until , _ = time .ParseDuration (args [1 ])
431
431
}
432
432
433
- id := target .Identifier .(* Identity )
433
+ id := target .Identifier .(* identity )
434
434
h .auth .Ban (id .PublicKey (), until )
435
435
h .auth .BanAddr (id .RemoteAddr (), until )
436
436
@@ -500,7 +500,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
500
500
}
501
501
room .Ops .Add (set .Keyize (user .ID ()))
502
502
503
- h .auth .Op (user .Identifier .(* Identity ).PublicKey (), until )
503
+ h .auth .Op (user .Identifier .(* identity ).PublicKey (), until )
504
504
505
505
body := fmt .Sprintf ("Made op by %s." , msg .From ().Name ())
506
506
room .Send (message .NewSystemMsg (body , user ))
0 commit comments