summaryrefslogtreecommitdiffstats
path: root/client/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/client.go')
-rw-r--r--client/client.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/client/client.go b/client/client.go
index 0fe967f..775fbb6 100644
--- a/client/client.go
+++ b/client/client.go
@@ -63,6 +63,26 @@ func (c *Client) SendMessage(target, content string) error {
return core.Send(c.conn, msg)
}
+func (c *Client) Join(channel string) error {
+ umod := core.Usermode{
+ UserAddr: c.uname + "@" + c.addr,
+ ChannelName: channel,
+ Mode: core.UsermodeInChannel,
+ }
+
+ return core.Send(c.conn, umod)
+}
+
+func (c *Client) Leave(channel string) error {
+ umod := core.Usermode{
+ UserAddr: c.uname + "@" + c.addr,
+ ChannelName: channel,
+ Mode: core.UsermodeNone,
+ }
+
+ return core.Send(c.conn, umod)
+}
+
func (c *Client) read() {
for {
payload, err := core.Read(c.conn)