Browse Source

theater: Remove THEATER command for now

tags/v0.1.0
Daniel Oaks 7 years ago
parent
commit
266c534af9
7 changed files with 2 additions and 156 deletions
  1. 1
    0
      CHANGELOG.md
  2. 0
    2
      README.md
  3. 0
    5
      irc/commands.go
  4. 0
    14
      irc/config.go
  5. 1
    2
      irc/modes.go
  6. 0
    2
      irc/server.go
  7. 0
    131
      irc/theater.go

+ 1
- 0
CHANGELOG.md View File

@@ -35,6 +35,7 @@ Initial release of Oragono!
35 35
 
36 36
 ### Removed
37 37
 * Removed gitconfig configuration format [replaced with YAML].
38
+* Removed `THEATER` command (it broke and I'm not that interested in putting the work in to get it working again with the aim of this project. PRs accepted).
38 39
 
39 40
 ### Fixed
40 41
 * Fixed clients no longer being able to send commands after a single command errored out.

+ 0
- 2
README.md View File

@@ -12,8 +12,6 @@ Also see the [mammon](https://github.com/mammon-ircd/mammon) IRC daemon for a si
12 12
 
13 13
 This project adheres to [Semantic Versioning](http://semver.org/). For the purposes of versioning, we consider the "public API" to refer to the configuration files, CLI interface and database format.
14 14
 
15
-*NOTE: Things are probably very broken right now. The `THEATER` command does not work, and I'm currently most of the way through rearchitecting the command handling. It should be finished apart from the `THEATER` command, but things are probably still broken.*
16
-
17 15
 ## Features
18 16
 
19 17
 * UTF-8 nick and channel names

+ 0
- 5
irc/commands.go View File

@@ -161,11 +161,6 @@ var Commands = map[string]Command{
161 161
 		handler:   regHandler,
162 162
 		minParams: 3,
163 163
 	},
164
-	/*TODO(dan): Add this back in
165
-	"THEATRE": Command{
166
-		handler:   theatreHandler,
167
-		minParams: 1,
168
-	},*/
169 164
 	"TIME": {
170 165
 		handler:   timeHandler,
171 166
 		minParams: 0,

+ 0
- 14
irc/config.go View File

@@ -94,8 +94,6 @@ type Config struct {
94 94
 
95 95
 	Operator map[string]*PassConfig
96 96
 
97
-	Theater map[string]*PassConfig
98
-
99 97
 	Limits struct {
100 98
 		NickLen       int  `yaml:"nicklen"`
101 99
 		ChannelLen    int  `yaml:"channellen"`
@@ -113,18 +111,6 @@ func (conf *Config) Operators() map[Name][]byte {
113 111
 	return operators
114 112
 }
115 113
 
116
-func (conf *Config) Theaters() map[Name][]byte {
117
-	theaters := make(map[Name][]byte)
118
-	for s, theaterConf := range conf.Theater {
119
-		name := NewName(s)
120
-		if !name.IsChannel() {
121
-			log.Fatal("config uses a non-channel for a theater!")
122
-		}
123
-		theaters[name] = theaterConf.PasswordBytes()
124
-	}
125
-	return theaters
126
-}
127
-
128 114
 func (conf *Config) TLSListeners() map[Name]*tls.Config {
129 115
 	tlsListeners := make(map[Name]*tls.Config)
130 116
 	for s, tlsListenersConf := range conf.Server.TLSListeners {

+ 1
- 2
irc/modes.go View File

@@ -173,14 +173,13 @@ const (
173 173
 	Persistent  ChannelMode = 'P' // flag
174 174
 	ReOp        ChannelMode = 'r' // flag
175 175
 	Secret      ChannelMode = 's' // flag
176
-	Theater     ChannelMode = 'T' // flag, nonstandard
177 176
 	UserLimit   ChannelMode = 'l' // flag arg
178 177
 )
179 178
 
180 179
 var (
181 180
 	SupportedChannelModes = ChannelModes{
182 181
 		BanMask, ExceptMask, InviteMask, InviteOnly, Key, NoOutside,
183
-		OpOnlyTopic, Persistent, Secret, Theater, UserLimit,
182
+		OpOnlyTopic, Persistent, Secret, UserLimit,
184 183
 	}
185 184
 	// supportedChannelModesString acts as a cache for when we introduce users
186 185
 	supportedChannelModesString = SupportedChannelModes.String()

+ 0
- 2
irc/server.go View File

@@ -53,7 +53,6 @@ type Server struct {
53 53
 	signals             chan os.Signal
54 54
 	proxyAllowedFrom    []string
55 55
 	whoWas              *WhoWasList
56
-	theaters            map[Name][]byte
57 56
 	isupport            *ISupportList
58 57
 	checkIdent          bool
59 58
 }
@@ -92,7 +91,6 @@ func NewServer(config *Config) *Server {
92 91
 		signals:          make(chan os.Signal, len(SERVER_SIGNALS)),
93 92
 		proxyAllowedFrom: config.Server.ProxyAllowedFrom,
94 93
 		whoWas:           NewWhoWasList(config.Limits.WhowasEntries),
95
-		theaters:         config.Theaters(),
96 94
 		checkIdent:       config.Server.CheckIdent,
97 95
 	}
98 96
 

+ 0
- 131
irc/theater.go View File

@@ -1,131 +0,0 @@
1
-// Copyright (c) 2012-2014 Jeremy Latt
2
-// Copyright (c) 2014-2015 Edmund Huber
3
-// released under the MIT license
4
-
5
-package irc
6
-
7
-type TheaterClient Name
8
-
9
-func (c TheaterClient) Id() Name {
10
-	return Name(c)
11
-}
12
-
13
-func (c TheaterClient) Nick() Name {
14
-	return Name(c)
15
-}
16
-
17
-/*
18
-func (m *TheaterIdentifyCommand) LoadPassword(s *Server) {
19
-	m.hash = s.theaters[m.channel]
20
-}
21
-
22
-	if upperSubCmd := strings.ToUpper(args[0]); upperSubCmd == "IDENTIFY" && len(args) == 3 {
23
-		return &TheaterIdentifyCommand{
24
-			channel:     NewName(args[1]),
25
-			PassCommand: PassCommand{password: []byte(args[2])},
26
-		}, nil
27
-	} else if upperSubCmd == "PRIVMSG" && len(args) == 4 {
28
-		return &TheaterPrivMsgCommand{
29
-			channel: NewName(args[1]),
30
-			asNick:  NewName(args[2]),
31
-			message: NewText(args[3]),
32
-		}, nil
33
-	} else if upperSubCmd == "ACTION" && len(args) == 4 {
34
-		return &TheaterActionCommand{
35
-			channel: NewName(args[1]),
36
-			asNick:  NewName(args[2]),
37
-			action:  NewCTCPText(args[3]),
38
-		}, nil
39
-	} else {
40
-		return nil, ErrParseCommand
41
-	}
42
-func (m *TheaterIdentifyCommand) HandleServer(s *Server) {
43
-	client := m.Client()
44
-	if !m.channel.IsChannel() {
45
-		client.ErrNoSuchChannel(m.channel)
46
-		return
47
-	}
48
-
49
-	channel := s.channels.Get(m.channel)
50
-	if channel == nil {
51
-		client.ErrNoSuchChannel(m.channel)
52
-		return
53
-	}
54
-
55
-	if (m.hash == nil) || (m.err != nil) {
56
-		client.ErrPasswdMismatch()
57
-		return
58
-	}
59
-
60
-	if channel.members.AnyHasMode(Theater) {
61
-		client.Reply(RplNotice(s, client, "someone else is +T in this channel"))
62
-		return
63
-	}
64
-
65
-	channel.members[client][Theater] = true
66
-}
67
-
68
-type TheaterPrivMsgCommand struct {
69
-	BaseCommand
70
-	channel Name
71
-	asNick  Name
72
-	message Text
73
-}
74
-
75
-func (m *TheaterPrivMsgCommand) HandleServer(s *Server) {
76
-	client := m.Client()
77
-
78
-	if !m.channel.IsChannel() {
79
-		client.ErrNoSuchChannel(m.channel)
80
-		return
81
-	}
82
-
83
-	channel := s.channels.Get(m.channel)
84
-	if channel == nil {
85
-		client.ErrNoSuchChannel(m.channel)
86
-		return
87
-	}
88
-
89
-	if !channel.members.HasMode(client, Theater) {
90
-		client.Reply(RplNotice(s, client, "you are not +T"))
91
-		return
92
-	}
93
-
94
-	reply := RplPrivMsg(TheaterClient(m.asNick), channel, m.message)
95
-	for member := range channel.members {
96
-		member.Reply(reply)
97
-	}
98
-}
99
-
100
-type TheaterActionCommand struct {
101
-	BaseCommand
102
-	channel Name
103
-	asNick  Name
104
-	action  CTCPText
105
-}
106
-
107
-func (m *TheaterActionCommand) HandleServer(s *Server) {
108
-	client := m.Client()
109
-
110
-	if !m.channel.IsChannel() {
111
-		client.ErrNoSuchChannel(m.channel)
112
-		return
113
-	}
114
-
115
-	channel := s.channels.Get(m.channel)
116
-	if channel == nil {
117
-		client.ErrNoSuchChannel(m.channel)
118
-		return
119
-	}
120
-
121
-	if !channel.members.HasMode(client, Theater) {
122
-		client.Reply(RplNotice(s, client, "you are not +T"))
123
-		return
124
-	}
125
-
126
-	reply := RplCTCPAction(TheaterClient(m.asNick), channel, m.action)
127
-	for member := range channel.members {
128
-		member.Reply(reply)
129
-	}
130
-}
131
-*/

Loading…
Cancel
Save