mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-25 13:29:27 +01:00
theater: Remove THEATER command for now
This commit is contained in:
parent
79d831bbb7
commit
266c534af9
@ -35,6 +35,7 @@ Initial release of Oragono!
|
|||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
* Removed gitconfig configuration format [replaced with YAML].
|
* 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
|
||||||
* Fixed clients no longer being able to send commands after a single command errored out.
|
* Fixed clients no longer being able to send commands after a single command errored out.
|
||||||
|
@ -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.
|
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
|
## Features
|
||||||
|
|
||||||
* UTF-8 nick and channel names
|
* UTF-8 nick and channel names
|
||||||
|
@ -161,11 +161,6 @@ var Commands = map[string]Command{
|
|||||||
handler: regHandler,
|
handler: regHandler,
|
||||||
minParams: 3,
|
minParams: 3,
|
||||||
},
|
},
|
||||||
/*TODO(dan): Add this back in
|
|
||||||
"THEATRE": Command{
|
|
||||||
handler: theatreHandler,
|
|
||||||
minParams: 1,
|
|
||||||
},*/
|
|
||||||
"TIME": {
|
"TIME": {
|
||||||
handler: timeHandler,
|
handler: timeHandler,
|
||||||
minParams: 0,
|
minParams: 0,
|
||||||
|
@ -94,8 +94,6 @@ type Config struct {
|
|||||||
|
|
||||||
Operator map[string]*PassConfig
|
Operator map[string]*PassConfig
|
||||||
|
|
||||||
Theater map[string]*PassConfig
|
|
||||||
|
|
||||||
Limits struct {
|
Limits struct {
|
||||||
NickLen int `yaml:"nicklen"`
|
NickLen int `yaml:"nicklen"`
|
||||||
ChannelLen int `yaml:"channellen"`
|
ChannelLen int `yaml:"channellen"`
|
||||||
@ -113,18 +111,6 @@ func (conf *Config) Operators() map[Name][]byte {
|
|||||||
return operators
|
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 {
|
func (conf *Config) TLSListeners() map[Name]*tls.Config {
|
||||||
tlsListeners := make(map[Name]*tls.Config)
|
tlsListeners := make(map[Name]*tls.Config)
|
||||||
for s, tlsListenersConf := range conf.Server.TLSListeners {
|
for s, tlsListenersConf := range conf.Server.TLSListeners {
|
||||||
|
@ -173,14 +173,13 @@ const (
|
|||||||
Persistent ChannelMode = 'P' // flag
|
Persistent ChannelMode = 'P' // flag
|
||||||
ReOp ChannelMode = 'r' // flag
|
ReOp ChannelMode = 'r' // flag
|
||||||
Secret ChannelMode = 's' // flag
|
Secret ChannelMode = 's' // flag
|
||||||
Theater ChannelMode = 'T' // flag, nonstandard
|
|
||||||
UserLimit ChannelMode = 'l' // flag arg
|
UserLimit ChannelMode = 'l' // flag arg
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
SupportedChannelModes = ChannelModes{
|
SupportedChannelModes = ChannelModes{
|
||||||
BanMask, ExceptMask, InviteMask, InviteOnly, Key, NoOutside,
|
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 acts as a cache for when we introduce users
|
||||||
supportedChannelModesString = SupportedChannelModes.String()
|
supportedChannelModesString = SupportedChannelModes.String()
|
||||||
|
@ -53,7 +53,6 @@ type Server struct {
|
|||||||
signals chan os.Signal
|
signals chan os.Signal
|
||||||
proxyAllowedFrom []string
|
proxyAllowedFrom []string
|
||||||
whoWas *WhoWasList
|
whoWas *WhoWasList
|
||||||
theaters map[Name][]byte
|
|
||||||
isupport *ISupportList
|
isupport *ISupportList
|
||||||
checkIdent bool
|
checkIdent bool
|
||||||
}
|
}
|
||||||
@ -92,7 +91,6 @@ func NewServer(config *Config) *Server {
|
|||||||
signals: make(chan os.Signal, len(SERVER_SIGNALS)),
|
signals: make(chan os.Signal, len(SERVER_SIGNALS)),
|
||||||
proxyAllowedFrom: config.Server.ProxyAllowedFrom,
|
proxyAllowedFrom: config.Server.ProxyAllowedFrom,
|
||||||
whoWas: NewWhoWasList(config.Limits.WhowasEntries),
|
whoWas: NewWhoWasList(config.Limits.WhowasEntries),
|
||||||
theaters: config.Theaters(),
|
|
||||||
checkIdent: config.Server.CheckIdent,
|
checkIdent: config.Server.CheckIdent,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
131
irc/theater.go
131
irc/theater.go
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
Loading…
Reference in New Issue
Block a user