diff --git a/CHANGELOG.md b/CHANGELOG.md index 159ae582..02db8f9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ Initial release of Oragono! ### Removed * Removed gitconfig configuration format [replaced with YAML]. +* 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). ### Fixed * Fixed clients no longer being able to send commands after a single command errored out. diff --git a/README.md b/README.md index 70229b6d..7e0e50f4 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ Also see the [mammon](https://github.com/mammon-ircd/mammon) IRC daemon for a si 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. -*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.* - ## Features * UTF-8 nick and channel names diff --git a/irc/commands.go b/irc/commands.go index a30967dc..7a3b3689 100644 --- a/irc/commands.go +++ b/irc/commands.go @@ -161,11 +161,6 @@ var Commands = map[string]Command{ handler: regHandler, minParams: 3, }, - /*TODO(dan): Add this back in - "THEATRE": Command{ - handler: theatreHandler, - minParams: 1, - },*/ "TIME": { handler: timeHandler, minParams: 0, diff --git a/irc/config.go b/irc/config.go index 7b51ec54..22d267e6 100644 --- a/irc/config.go +++ b/irc/config.go @@ -94,8 +94,6 @@ type Config struct { Operator map[string]*PassConfig - Theater map[string]*PassConfig - Limits struct { NickLen int `yaml:"nicklen"` ChannelLen int `yaml:"channellen"` @@ -113,18 +111,6 @@ func (conf *Config) Operators() map[Name][]byte { return operators } -func (conf *Config) Theaters() map[Name][]byte { - theaters := make(map[Name][]byte) - for s, theaterConf := range conf.Theater { - name := NewName(s) - if !name.IsChannel() { - log.Fatal("config uses a non-channel for a theater!") - } - theaters[name] = theaterConf.PasswordBytes() - } - return theaters -} - func (conf *Config) TLSListeners() map[Name]*tls.Config { tlsListeners := make(map[Name]*tls.Config) for s, tlsListenersConf := range conf.Server.TLSListeners { diff --git a/irc/modes.go b/irc/modes.go index afc17dd0..d48ea8cb 100644 --- a/irc/modes.go +++ b/irc/modes.go @@ -173,14 +173,13 @@ const ( Persistent ChannelMode = 'P' // flag ReOp ChannelMode = 'r' // flag Secret ChannelMode = 's' // flag - Theater ChannelMode = 'T' // flag, nonstandard UserLimit ChannelMode = 'l' // flag arg ) var ( SupportedChannelModes = ChannelModes{ BanMask, ExceptMask, InviteMask, InviteOnly, Key, NoOutside, - OpOnlyTopic, Persistent, Secret, Theater, UserLimit, + OpOnlyTopic, Persistent, Secret, UserLimit, } // supportedChannelModesString acts as a cache for when we introduce users supportedChannelModesString = SupportedChannelModes.String() diff --git a/irc/server.go b/irc/server.go index efb7814f..e84b81d1 100644 --- a/irc/server.go +++ b/irc/server.go @@ -53,7 +53,6 @@ type Server struct { signals chan os.Signal proxyAllowedFrom []string whoWas *WhoWasList - theaters map[Name][]byte isupport *ISupportList checkIdent bool } @@ -92,7 +91,6 @@ func NewServer(config *Config) *Server { signals: make(chan os.Signal, len(SERVER_SIGNALS)), proxyAllowedFrom: config.Server.ProxyAllowedFrom, whoWas: NewWhoWasList(config.Limits.WhowasEntries), - theaters: config.Theaters(), checkIdent: config.Server.CheckIdent, } diff --git a/irc/theater.go b/irc/theater.go deleted file mode 100644 index 4fdef653..00000000 --- a/irc/theater.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) 2012-2014 Jeremy Latt -// Copyright (c) 2014-2015 Edmund Huber -// released under the MIT license - -package irc - -type TheaterClient Name - -func (c TheaterClient) Id() Name { - return Name(c) -} - -func (c TheaterClient) Nick() Name { - return Name(c) -} - -/* -func (m *TheaterIdentifyCommand) LoadPassword(s *Server) { - m.hash = s.theaters[m.channel] -} - - if upperSubCmd := strings.ToUpper(args[0]); upperSubCmd == "IDENTIFY" && len(args) == 3 { - return &TheaterIdentifyCommand{ - channel: NewName(args[1]), - PassCommand: PassCommand{password: []byte(args[2])}, - }, nil - } else if upperSubCmd == "PRIVMSG" && len(args) == 4 { - return &TheaterPrivMsgCommand{ - channel: NewName(args[1]), - asNick: NewName(args[2]), - message: NewText(args[3]), - }, nil - } else if upperSubCmd == "ACTION" && len(args) == 4 { - return &TheaterActionCommand{ - channel: NewName(args[1]), - asNick: NewName(args[2]), - action: NewCTCPText(args[3]), - }, nil - } else { - return nil, ErrParseCommand - } -func (m *TheaterIdentifyCommand) HandleServer(s *Server) { - client := m.Client() - if !m.channel.IsChannel() { - client.ErrNoSuchChannel(m.channel) - return - } - - channel := s.channels.Get(m.channel) - if channel == nil { - client.ErrNoSuchChannel(m.channel) - return - } - - if (m.hash == nil) || (m.err != nil) { - client.ErrPasswdMismatch() - return - } - - if channel.members.AnyHasMode(Theater) { - client.Reply(RplNotice(s, client, "someone else is +T in this channel")) - return - } - - channel.members[client][Theater] = true -} - -type TheaterPrivMsgCommand struct { - BaseCommand - channel Name - asNick Name - message Text -} - -func (m *TheaterPrivMsgCommand) HandleServer(s *Server) { - client := m.Client() - - if !m.channel.IsChannel() { - client.ErrNoSuchChannel(m.channel) - return - } - - channel := s.channels.Get(m.channel) - if channel == nil { - client.ErrNoSuchChannel(m.channel) - return - } - - if !channel.members.HasMode(client, Theater) { - client.Reply(RplNotice(s, client, "you are not +T")) - return - } - - reply := RplPrivMsg(TheaterClient(m.asNick), channel, m.message) - for member := range channel.members { - member.Reply(reply) - } -} - -type TheaterActionCommand struct { - BaseCommand - channel Name - asNick Name - action CTCPText -} - -func (m *TheaterActionCommand) HandleServer(s *Server) { - client := m.Client() - - if !m.channel.IsChannel() { - client.ErrNoSuchChannel(m.channel) - return - } - - channel := s.channels.Get(m.channel) - if channel == nil { - client.ErrNoSuchChannel(m.channel) - return - } - - if !channel.members.HasMode(client, Theater) { - client.Reply(RplNotice(s, client, "you are not +T")) - return - } - - reply := RplCTCPAction(TheaterClient(m.asNick), channel, m.action) - for member := range channel.members { - member.Reply(reply) - } -} -*/