@@ -18,8 +18,8 @@ import (
1818
1919const maxInputLength int = 1024
2020
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 {
2323 name := user .Name ()
2424 cfg := user .Config ()
2525 if cfg .Theme != nil {
@@ -90,8 +90,8 @@ func (h *Host) isOp(conn sshd.Connection) bool {
9090
9191// Connect a specific Terminal to this host and its room.
9292func (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 )
9595 cfg := user .Config ()
9696 cfg .Theme = & h .theme
9797 user .SetConfig (cfg )
@@ -115,7 +115,7 @@ func (h *Host) Connect(term *sshd.Terminal) {
115115 member , err := h .Join (user )
116116 if err != nil {
117117 // Try again...
118- id .SetName (fmt .Sprintf ("Guest%d" , count ))
118+ ident .SetName (fmt .Sprintf ("Guest%d" , count ))
119119 member , err = h .Join (user )
120120 }
121121 if err != nil {
@@ -124,7 +124,7 @@ func (h *Host) Connect(term *sshd.Terminal) {
124124 }
125125
126126 // Successfully joined.
127- term .SetPrompt (GetPrompt (user ))
127+ term .SetPrompt (getPrompt (user ))
128128 term .AutoCompleteCallback = h .AutoCompleteFunction (user )
129129 user .SetHighlight (user .Name ())
130130
@@ -172,7 +172,7 @@ func (h *Host) Connect(term *sshd.Terminal) {
172172 //
173173 // FIXME: This is hacky, how do we improve the API to allow for
174174 // this? Chat module shouldn't know about terminals.
175- term .SetPrompt (GetPrompt (user ))
175+ term .SetPrompt (getPrompt (user ))
176176 user .SetHighlight (user .Name ())
177177 }
178178 }
@@ -344,7 +344,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
344344 return errors .New ("user not found" )
345345 }
346346
347- id := target .Identifier .(* Identity )
347+ id := target .Identifier .(* identity )
348348 var whois string
349349 switch room .IsOp (msg .From ()) {
350350 case true :
@@ -430,7 +430,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
430430 until , _ = time .ParseDuration (args [1 ])
431431 }
432432
433- id := target .Identifier .(* Identity )
433+ id := target .Identifier .(* identity )
434434 h .auth .Ban (id .PublicKey (), until )
435435 h .auth .BanAddr (id .RemoteAddr (), until )
436436
@@ -500,7 +500,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
500500 }
501501 room .Ops .Add (set .Keyize (user .ID ()))
502502
503- h .auth .Op (user .Identifier .(* Identity ).PublicKey (), until )
503+ h .auth .Op (user .Identifier .(* identity ).PublicKey (), until )
504504
505505 body := fmt .Sprintf ("Made op by %s." , msg .From ().Name ())
506506 room .Send (message .NewSystemMsg (body , user ))
0 commit comments