1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 09:23:38 +02:00

Merge branch 'master' into ircv3

This commit is contained in:
Tristan B. Velloza Kildaire 2023-03-25 13:17:51 +02:00
commit 9bd8c2814c

View File

@ -199,6 +199,29 @@ public class Client : Thread
}
}
/**
* Requests setting of the provided nickname
*
* Params:
* nickname = the nickname to request
* Throws:
* BirchwoodException on invalid nickname
*/
public void nick(string nickname)
{
/* Ensure no illegal characters in nick name */
if(isValidText(nickname))
{
/* Set the nick */
Message nickMessage = new Message("", "NICK", nickname);
sendMessage(nickMessage);
}
else
{
throw new BirchwoodException(ErrorType.ILLEGAL_CHARACTERS);
}
}
/**
* Joins the requested channel
*
@ -1041,7 +1064,8 @@ public class Client : Thread
// TODO: The below should all be automatic, maybe once IRCV3 is done
// ... we should automate sending in NICK and USER stuff
Thread.sleep(dur!("seconds")(2));
client.command(new Message("", "NICK", "birchwood")); // TODO: add nickcommand
// client.command(new Message("", "NICK", "birchwood")); // TODO: add nickcommand
client.nick("birchwood");
Thread.sleep(dur!("seconds")(2));
client.command(new Message("", "USER", "doggie doggie irc.frdeenode.net :Tristan B. Kildaire"));