mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-22 02:52:00 -08:00
rudimentary (broken) invite support
This commit is contained in:
parent
55f7c89468
commit
d7d6263e35
5 changed files with 244 additions and 46 deletions
|
|
@ -119,3 +119,20 @@ func (ch *Channel) ChangeTopic(cl *Client, newTopic string) {
|
|||
ch.Send(RplNoTopic(ch), nil)
|
||||
}
|
||||
}
|
||||
|
||||
func (ch *Channel) Invite(inviter *Client, invitee *Client) {
|
||||
if !ch.members[inviter] {
|
||||
inviter.send <- ErrNotOnChannel(ch)
|
||||
return
|
||||
}
|
||||
|
||||
if ch.members[invitee] {
|
||||
inviter.send <- ErrUserOnChannel(ch, invitee)
|
||||
return
|
||||
}
|
||||
|
||||
ch.invites[invitee.nick] = true
|
||||
|
||||
invitee.send <- RplInviteMsg(ch, inviter)
|
||||
inviter.send <- RplInvitingMsg(ch, invitee)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue