X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=room.go;h=99ec208e573ff97be207abeb8fd6f475807a8ec6;hb=5a17f44b24340dc970bbbbfb7420fb86f88837b7;hp=ccfdb077b24b638d3a83adf1bbaa692fc4ab49a7;hpb=4f5fa5132780b50c7f2b51329b2a68d3cbbff939;p=goircd.git diff --git a/room.go b/room.go index ccfdb07..99ec208 100644 --- a/room.go +++ b/room.go @@ -1,6 +1,6 @@ /* goircd -- minimalistic simple Internet Relay Chat (IRC) server -Copyright (C) 2014 Sergey Matveev +Copyright (C) 2014-2015 Sergey Matveev 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 @@ -15,6 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ + package main import ( @@ -41,16 +42,16 @@ type Room struct { topic string key string members map[*Client]bool - hostname string + hostname *string logSink chan<- LogEvent stateSink chan<- StateEvent } -func (r Room) String() string { - return r.name +func (room Room) String() string { + return room.name } -func NewRoom(hostname, name string, logSink chan<- LogEvent, stateSink chan<- StateEvent) *Room { +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 = "" @@ -128,7 +129,7 @@ func (room *Room) Processor(events <-chan ClientEvent) { 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: