+GLOBAL bool
+Channel_AddBan(CHANNEL *c, const char *mask )
+{
+ struct list_head *h = Channel_GetListBans(c);
+ return Lists_Add(h, mask, false);
+}
+
+
+GLOBAL bool
+Channel_AddInvite(CHANNEL *c, const char *mask, bool onlyonce)
+{
+ struct list_head *h = Channel_GetListInvites(c);
+ return Lists_Add(h, mask, onlyonce);
+}
+
+
+static bool
+ShowInvitesBans(struct list_head *head, CLIENT *Client, CHANNEL *Channel, bool invite)
+{
+ struct list_elem *e;
+ char *msg = invite ? RPL_INVITELIST_MSG : RPL_BANLIST_MSG;
+ char *msg_end;
+
+ assert( Client != NULL );
+ assert( Channel != NULL );
+
+ e = Lists_GetFirst(head);
+ while (e) {
+ if( ! IRC_WriteStrClient( Client, msg, Client_ID( Client ),
+ Channel_Name( Channel ), Lists_GetMask(e) )) return DISCONNECTED;
+ e = Lists_GetNext(e);
+ }
+
+ msg_end = invite ? RPL_ENDOFINVITELIST_MSG : RPL_ENDOFBANLIST_MSG;
+ return IRC_WriteStrClient( Client, msg_end, Client_ID( Client ), Channel_Name( Channel ));
+}
+
+
+GLOBAL bool
+Channel_ShowBans( CLIENT *Client, CHANNEL *Channel )
+{
+ struct list_head *h;
+
+ assert( Channel != NULL );
+
+ h = Channel_GetListBans(Channel);
+ return ShowInvitesBans(h, Client, Channel, false);
+}
+
+
+GLOBAL bool
+Channel_ShowInvites( CLIENT *Client, CHANNEL *Channel )
+{
+ struct list_head *h;
+
+ assert( Channel != NULL );
+
+ h = Channel_GetListInvites(Channel);
+ return ShowInvitesBans(h, Client, Channel, true);
+}
+
+
+/**
+ * Log a message to the local &SERVER channel, if it exists.
+ */
+GLOBAL void
+Channel_LogServer(char *msg)
+{
+ CHANNEL *sc;
+ CLIENT *c;
+
+ assert(msg != NULL);
+
+ sc = Channel_Search("&SERVER");
+ if (!sc)
+ return;
+
+ c = Client_ThisServer();
+ Channel_Write(sc, c, c, "PRIVMSG", false, msg);
+} /* Channel_LogServer */
+
+