]> jfr.im git - solanum.git/blobdiff - src/channel.c
Merge pull request #53 from ShadowNinja/clarify_U+R
[solanum.git] / src / channel.c
index 20c0dc2c53f29ace90b286fbc28464c708b0658a..e6a47a0b39271583b85f2bf3dd911e868adb9353 100644 (file)
@@ -2,9 +2,9 @@
  *  ircd-ratbox: A slightly useful ircd.
  *  channel.c: Controls channels.
  *
- * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center 
- * Copyright (C) 1996-2002 Hybrid Development Team 
- * Copyright (C) 2002-2005 ircd-ratbox development team 
+ * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
+ * Copyright (C) 1996-2002 Hybrid Development Team
+ * Copyright (C) 2002-2005 ircd-ratbox development team
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -42,6 +42,7 @@
 #include "s_newconf.h"
 #include "logger.h"
 #include "ipv4_from_ipv6.h"
+#include "s_assert.h"
 
 struct config_channel_entry ConfigChannel;
 rb_dlink_list global_channel_list;
@@ -136,6 +137,12 @@ send_channel_join(struct Channel *chptr, struct Client *client_p)
                                             client_p->name, client_p->username, client_p->host, chptr->chname,
                                             EmptyString(client_p->user->suser) ? "*" : client_p->user->suser,
                                             client_p->info);
+
+       /* Send away message to away-notify enabled clients. */
+       if (client_p->user->away)
+               sendto_channel_local_with_capability_butone(client_p, ALL_MEMBERS, CLICAP_AWAY_NOTIFY, NOCAPS, chptr,
+                                                           ":%s!%s@%s AWAY :%s", client_p->name, client_p->username,
+                                                           client_p->host, client_p->user->away);
 }
 
 /* find_channel_membership()
@@ -211,7 +218,7 @@ find_channel_status(struct membership *msptr, int combine)
 /* add_user_to_channel()
  *
  * input       - channel to add client to, client to add, channel flags
- * output      - 
+ * output      -
  * side effects - user is added to channel
  */
 void
@@ -761,7 +768,7 @@ can_join(struct Client *source_p, struct Channel *chptr, const char *key, const
        /* join throttling stuff --nenolod */
        else if(chptr->mode.join_num > 0 && chptr->mode.join_time > 0)
        {
-               if ((rb_current_time() - chptr->join_delta <= 
+               if ((rb_current_time() - chptr->join_delta <=
                        chptr->mode.join_time) && (chptr->join_count >=
                        chptr->mode.join_num))
                        i = ERR_THROTTLE;
@@ -857,7 +864,7 @@ can_send(struct Channel *chptr, struct Client *source_p, struct membership *mspt
  * flood_attack_channel
  * inputs       - flag 0 if PRIVMSG 1 if NOTICE. RFC
  *                says NOTICE must not auto reply
- *              - pointer to source Client 
+ *              - pointer to source Client
  *             - pointer to target channel
  * output      - 1 if target is under flood attack
  * side effects        - check for flood attack on target chptr
@@ -1065,7 +1072,7 @@ allocate_topic(struct Channel *chptr)
 
        /* Basically we allocate one large block for the topic and
         * the topic info.  We then split it up into two and shove it
-        * in the chptr 
+        * in the chptr
         */
        chptr->topic = ptr;
        chptr->topic_info = (char *) ptr + TOPICLEN + 1;
@@ -1343,7 +1350,7 @@ resv_chan_forcepart(const char *name, const char *reason, int temp_time)
                        /* notify opers & user they were removed from the channel */
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                             "Forced PART for %s!%s@%s from %s (%s)",
-                                            target_p->name, target_p->username, 
+                                            target_p->name, target_p->username,
                                             target_p->host, name, reason);
 
                        if(temp_time > 0)