/*
goircd -- minimalistic simple Internet Relay Chat (IRC) server
-Copyright (C) 2014 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2015 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
package main
import (
topic string
key string
members map[*Client]bool
- hostname string
+ hostname *string
logSink chan<- LogEvent
stateSink chan<- StateEvent
}
-func NewRoom(hostname, name string, logSink chan<- LogEvent, stateSink chan<- StateEvent) *Room {
+func (room Room) String() string {
+ return room.name
+}
+
+func NewRoom(hostname *string, name string, logSink chan<- LogEvent, stateSink chan<- StateEvent) *Room {
room := Room{name: name}
room.members = make(map[*Client]bool)
room.topic = ""
room.StateSave()
case EventWho:
for m := range room.members {
- client.ReplyNicknamed("352", room.name, m.username, m.conn.RemoteAddr().String(), room.hostname, m.nickname, "H", "0 "+m.realname)
+ client.ReplyNicknamed("352", room.name, m.username, m.conn.RemoteAddr().String(), *room.hostname, m.nickname, "H", "0 "+m.realname)
}
client.ReplyNicknamed("315", room.name, "End of /WHO list")
case EventMode:
client.Msg(fmt.Sprintf("324 %s %s %s", client.nickname, room.name, mode))
continue
}
+ if strings.HasPrefix(event.text, "b") {
+ client.ReplyNicknamed("368", room.name, "End of channel ban list")
+ continue
+ }
if strings.HasPrefix(event.text, "-k") || strings.HasPrefix(event.text, "+k") {
if _, subscribed := room.members[client]; !subscribed {
client.ReplyParts("442", room.name, "You are not on that channel")