File tree Expand file tree Collapse file tree 3 files changed +18
-14
lines changed Expand file tree Collapse file tree 3 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 11package chat
22
33import (
4- "time"
5-
64 "github.com/shazow/ssh-chat/chat/message"
75 "github.com/shazow/ssh-chat/set"
86)
@@ -16,16 +14,10 @@ type roomMember struct {
1614type Member interface {
1715 message.Author
1816
19- SetName (string )
20-
2117 Config () message.UserConfig
2218 SetConfig (message.UserConfig )
2319
2420 Send (message.Message ) error
2521
26- Joined () time.Time
27- ReplyTo () message.Author
28- SetReplyTo (message.Author )
29- Prompt () string
30- SetHighlight (string ) error
22+ SetName (string )
3123}
Original file line number Diff line number Diff line change @@ -2,13 +2,15 @@ package sshchat
22
33import (
44 "sync"
5+ "time"
56
67 "github.com/shazow/ssh-chat/chat"
8+ "github.com/shazow/ssh-chat/chat/message"
79 "github.com/shazow/ssh-chat/sshd"
810)
911
1012type client struct {
11- chat. Member
13+ UserMember
1214 sync.Mutex
1315 conns []sshd.Connection
1416}
@@ -25,9 +27,19 @@ func (cl *client) Close() error {
2527 return nil
2628}
2729
28- type User interface {
30+ type UserMember interface {
2931 chat.Member
3032
33+ Joined () time.Time
34+ Prompt () string
35+ ReplyTo () message.Author
36+ SetHighlight (string ) error
37+ SetReplyTo (message.Author )
38+ }
39+
40+ type User interface {
41+ UserMember
42+
3143 Connections () []sshd.Connection
3244 Close () error
3345}
Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ func (h *Host) Connect(term *sshd.Terminal) {
7777 requestedName := term .Conn .Name ()
7878 screen := message .BufferedScreen (requestedName , term )
7979 user := & client {
80- Member : screen ,
81- conns : []sshd.Connection {term .Conn },
80+ UserMember : screen ,
81+ conns : []sshd.Connection {term .Conn },
8282 }
8383
8484 h .mu .Lock ()
@@ -316,7 +316,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
316316 return errors .New ("must specify message" )
317317 }
318318
319- target := msg .From ().(chat. Member ).ReplyTo ()
319+ target := msg .From ().(UserMember ).ReplyTo ()
320320 if target == nil {
321321 return errors .New ("no message to reply to" )
322322 }
You can’t perform that action at this time.
0 commit comments