diff options
Diffstat (limited to 'handle.c')
| -rw-r--r-- | handle.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/handle.c b/handle.c index 9c4590a..25c6875 100644 --- a/handle.c +++ b/handle.c @@ -518,6 +518,17 @@ setcreation(struct Message *msg, struct Peer *peer) } static int +sethostname(struct Message *msg, struct Peer *peer) +{ + ensure(peer->type == CONFIG, reply(peer, 481, "You're not a config file"), 0); + ensure(msg->params[0] && *msg->params[0], reply(peer, 461, msg->command), 0); + + strlcpy(hostname, msg->params[0], sizeof(hostname)); + + return 0; +} + +static int setinfo(struct Message *msg, struct Peer *peer) { ensure(peer->type == CONFIG, reply(peer, 481, "You're not a config file"), 0); @@ -649,6 +660,7 @@ static struct Handler { { "privmsg", privmsg }, { "quit", quit }, { "setcreation", setcreation }, + { "sethostname", sethostname }, { "setinfo", setinfo }, { "setoper", setoper }, { "user", user }, |