3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00

fix invite message to clients

This commit is contained in:
Jeremy Latt 2014-03-05 22:54:50 -08:00
parent d6688a3047
commit 04bb79a610
4 changed files with 6 additions and 8 deletions

View File

@ -456,9 +456,8 @@ func (channel *Channel) Invite(invitee *Client, inviter *Client) {
return return
} }
// TODO Modify channel masks
inviter.RplInviting(invitee, channel.name) inviter.RplInviting(invitee, channel.name)
invitee.Reply(RplInviteMsg(inviter, channel.name)) invitee.Reply(RplInviteMsg(inviter, invitee, channel.name))
if invitee.flags[Away] { if invitee.flags[Away] {
inviter.RplAway(invitee) inviter.RplAway(invitee)
} }

View File

@ -23,7 +23,7 @@ var (
) )
const ( const (
SEM_VER = "ergonomadic-1.2.12" SEM_VER = "ergonomadic-1.2.13"
CRLF = "\r\n" CRLF = "\r\n"
MAX_REPLY_LEN = 512 - len(CRLF) MAX_REPLY_LEN = 512 - len(CRLF)

View File

@ -128,8 +128,8 @@ func RplError(message string) string {
return NewStringReply(nil, ERROR, ":%s", message) return NewStringReply(nil, ERROR, ":%s", message)
} }
func RplInviteMsg(inviter *Client, channel string) string { func RplInviteMsg(inviter *Client, invitee *Client, channel string) string {
return NewStringReply(inviter, INVITE, channel) return NewStringReply(inviter, INVITE, "%s :%s", invitee.Nick(), channel)
} }
func RplKick(channel *Channel, client *Client, target *Client, comment string) string { func RplKick(channel *Channel, client *Client, target *Client, comment string) string {

View File

@ -853,9 +853,8 @@ func (msg *InviteCommand) HandleServer(server *Server) {
channel := server.channels.Get(msg.channel) channel := server.channels.Get(msg.channel)
if channel == nil { if channel == nil {
name := strings.ToLower(msg.channel) client.RplInviting(target, msg.channel)
client.RplInviting(target, name) target.Reply(RplInviteMsg(client, target, msg.channel))
target.Reply(RplInviteMsg(client, name))
return return
} }