|
@@ -51,9 +51,12 @@ func (m *TheaterIdentifyCommand) HandleServer(s *Server) {
|
51
|
51
|
return
|
52
|
52
|
}
|
53
|
53
|
|
54
|
|
- if !channel.members.AnyHasMode(Theater) {
|
55
|
|
- channel.members[client][Theater] = true
|
|
54
|
+ if channel.members.AnyHasMode(Theater) {
|
|
55
|
+ client.Reply(RplNotice(s, client, "someone else is +T in this channel"))
|
|
56
|
+ return
|
56
|
57
|
}
|
|
58
|
+
|
|
59
|
+ channel.members[client][Theater] = true
|
57
|
60
|
}
|
58
|
61
|
|
59
|
62
|
type TheaterPrivMsgCommand struct {
|
|
@@ -69,6 +72,7 @@ func (cmd *TheaterPrivMsgCommand) String() string {
|
69
|
72
|
}
|
70
|
73
|
func (m *TheaterPrivMsgCommand) HandleServer(s *Server) {
|
71
|
74
|
client := m.Client()
|
|
75
|
+
|
72
|
76
|
if !m.channel.IsChannel() {
|
73
|
77
|
client.ErrNoSuchChannel(m.channel)
|
74
|
78
|
return
|
|
@@ -80,10 +84,13 @@ func (m *TheaterPrivMsgCommand) HandleServer(s *Server) {
|
80
|
84
|
return
|
81
|
85
|
}
|
82
|
86
|
|
83
|
|
- if channel.members.HasMode(client, Theater) {
|
84
|
|
- for member := range channel.members {
|
85
|
|
- member.Reply(RplPrivMsg(TheaterClient(m.asNick), channel, m.message))
|
86
|
|
- }
|
|
87
|
+ if !channel.members.HasMode(client, Theater) {
|
|
88
|
+ client.Reply(RplNotice(s, client, "you are not +T"))
|
|
89
|
+ return
|
|
90
|
+ }
|
|
91
|
+
|
|
92
|
+ for member := range channel.members {
|
|
93
|
+ member.Reply(RplPrivMsg(TheaterClient(m.asNick), channel, m.message))
|
87
|
94
|
}
|
88
|
95
|
}
|
89
|
96
|
|
|
@@ -91,7 +98,7 @@ type TheaterActionCommand struct {
|
91
|
98
|
BaseCommand
|
92
|
99
|
channel Name
|
93
|
100
|
asNick Name
|
94
|
|
- action Text
|
|
101
|
+ action CTCPText
|
95
|
102
|
}
|
96
|
103
|
|
97
|
104
|
func (cmd *TheaterActionCommand) String() string {
|
|
@@ -100,7 +107,8 @@ func (cmd *TheaterActionCommand) String() string {
|
100
|
107
|
|
101
|
108
|
func (m *TheaterActionCommand) HandleServer(s *Server) {
|
102
|
109
|
client := m.Client()
|
103
|
|
- if m.channel.IsChannel() {
|
|
110
|
+
|
|
111
|
+ if !m.channel.IsChannel() {
|
104
|
112
|
client.ErrNoSuchChannel(m.channel)
|
105
|
113
|
return
|
106
|
114
|
}
|
|
@@ -111,9 +119,12 @@ func (m *TheaterActionCommand) HandleServer(s *Server) {
|
111
|
119
|
return
|
112
|
120
|
}
|
113
|
121
|
|
114
|
|
- if channel.members.HasMode(client, Theater) {
|
115
|
|
- for member := range channel.members {
|
116
|
|
- member.Reply(RplPrivMsg(TheaterClient(m.asNick), channel, NewText(fmt.Sprintf("\001ACTION %s\001", m.action))))
|
117
|
|
- }
|
|
122
|
+ if !channel.members.HasMode(client, Theater) {
|
|
123
|
+ client.Reply(RplNotice(s, client, "you are not +T"))
|
|
124
|
+ return
|
|
125
|
+ }
|
|
126
|
+
|
|
127
|
+ for member := range channel.members {
|
|
128
|
+ member.Reply(RplCTCPAction(TheaterClient(m.asNick), channel, m.action))
|
118
|
129
|
}
|
119
|
130
|
}
|