3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-28 23:19:30 +01:00

theater: Remove THEATER command for now

This commit is contained in:
Daniel Oaks 2016-09-12 12:31:25 +10:00
parent 79d831bbb7
commit 266c534af9
7 changed files with 2 additions and 156 deletions

View File

@ -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.

View File

@ -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

View File

@ -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,

View File

@ -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 {

View File

@ -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()

View File

@ -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,
}

View File

@ -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)
}
}
*/