From 245782897b4a8ca092a87bf6d3961cbda1dea962 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Fri, 27 Apr 2012 23:56:56 +0200 Subject: [PATCH] New function Client_CapSet() in addition to Client_Cap{Add|Del} --- src/ngircd/client-cap.c | 11 +++++++++++ src/ngircd/client-cap.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/ngircd/client-cap.c b/src/ngircd/client-cap.c index edaf2603..b0da8073 100644 --- a/src/ngircd/client-cap.c +++ b/src/ngircd/client-cap.c @@ -37,6 +37,17 @@ Client_Cap(CLIENT *Client) return Client->capabilities; } +GLOBAL void +Client_CapSet(CLIENT *Client, int Cap) +{ + assert(Client != NULL); + assert(Cap >= 0); + + Client->capabilities = Cap; + LogDebug("Set new capability of \"%s\" to %d.", + Client_ID(Client), Client->capabilities); +} + GLOBAL void Client_CapAdd(CLIENT *Client, int Cap) { diff --git a/src/ngircd/client-cap.h b/src/ngircd/client-cap.h index faec1c20..e477dc00 100644 --- a/src/ngircd/client-cap.h +++ b/src/ngircd/client-cap.h @@ -22,6 +22,7 @@ GLOBAL int Client_Cap PARAMS((CLIENT *Client)); +GLOBAL void Client_CapSet PARAMS((CLIENT *Client, int Cap)); GLOBAL void Client_CapAdd PARAMS((CLIENT *Client, int Cap)); GLOBAL void Client_CapDel PARAMS((CLIENT *Client, int Cap));