Host.Connect(): upon connection, initialize the user's symbol prefix to their key's comment.

This commit is contained in:
nato 2023-01-23 17:43:36 -08:00
parent 6ffc5ccb68
commit 3e6d7e08a3

View File

@ -101,6 +101,9 @@ func (h *Host) isOp(conn sshd.Connection) bool {
// Connect a specific Terminal to this host and its room.
func (h *Host) Connect(term *sshd.Terminal) {
id := NewIdentity(term.Conn)
id.SetSymbol(h.auth.comments[sshd.Fingerprint(id.PublicKey())])
user := message.NewUserScreen(id, term)
user.OnChange = func() {
term.SetPrompt(GetPrompt(user))