@@ -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 {
2323name := user .Name ()
2424cfg := user .Config ()
2525if 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 )
9595cfg := user .Config ()
9696cfg .Theme = & h .theme
9797user .SetConfig (cfg )
@@ -115,7 +115,7 @@ func (h *Host) Connect(term *sshd.Terminal) {
115115member , err := h .Join (user )
116116if err != nil {
117117// Try again...
118- id .SetName (fmt .Sprintf ("Guest%d" , count ))
118+ ident .SetName (fmt .Sprintf ("Guest%d" , count ))
119119member , err = h .Join (user )
120120}
121121if 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 ))
128128term .AutoCompleteCallback = h .AutoCompleteFunction (user )
129129user .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 ))
176176user .SetHighlight (user .Name ())
177177}
178178}
@@ -344,7 +344,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
344344return errors .New ("user not found" )
345345}
346346
347- id := target .Identifier .(* Identity )
347+ id := target .Identifier .(* identity )
348348var whois string
349349switch room .IsOp (msg .From ()) {
350350case true :
@@ -430,7 +430,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
430430until , _ = time .ParseDuration (args [1 ])
431431}
432432
433- id := target .Identifier .(* Identity )
433+ id := target .Identifier .(* identity )
434434h .auth .Ban (id .PublicKey (), until )
435435h .auth .BanAddr (id .RemoteAddr (), until )
436436
@@ -500,7 +500,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
500500}
501501room .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
505505body := fmt .Sprintf ("Made op by %s." , msg .From ().Name ())
506506room .Send (message .NewSystemMsg (body , user ))
0 commit comments