Merge remote branch 'upstream/master'
authorroot <root@mail.pk910.de>
Wed, 9 Nov 2011 15:27:40 +0000 (16:27 +0100)
committerroot <root@mail.pk910.de>
Wed, 9 Nov 2011 15:27:40 +0000 (16:27 +0100)
Conflicts:
src/chanserv.c

src/chanserv.c
src/mod-memoserv.c

index fa1827fa6e59d68c9455901faf960246d406c11f..11b2c74e5677e7a1292e62cb4044dc0f602dd946 100644 (file)
@@ -1498,7 +1498,7 @@ unregister_channel(struct chanData *channel, const char *reason)
 }
 
 static void
-expire_channels(UNUSED_ARG(void *data))
+expire_channels(void *data)
 {
     struct chanData *channel, *next;
     struct userData *user;
@@ -1529,7 +1529,7 @@ expire_channels(UNUSED_ARG(void *data))
         unregister_channel(channel, "registration expired.");
     }
 
-    if(chanserv_conf.channel_expire_frequency)
+    if(chanserv_conf.channel_expire_frequency && !data)
         timeq_add(now + chanserv_conf.channel_expire_frequency, expire_channels, NULL);
 }
 
@@ -2990,7 +2990,7 @@ cmd_trim_users(struct userNode *user, struct chanNode *channel, unsigned short m
     unsigned int count;
     unsigned long limit;
 
-    actor = GetChannelAccess(channel->channel_info, user->handle_info);
+    actor = GetChannelUser(channel->channel_info, user->handle_info);
     if(min_access > max_access)
     {
         send_message(user, chanserv, "CSMSG_BAD_RANGE", min_access, max_access);
@@ -3885,6 +3885,7 @@ static CHANSERV_FUNC(cmd_myaccess)
     {
         struct chanData *cData = uData->channel;
         ccount++;
+        unsigned int base_len;
 
         if(uData->access > UL_OWNER)
             continue;
@@ -3897,9 +3898,8 @@ static CHANSERV_FUNC(cmd_myaccess)
            && !IsNetworkHelper(user))
             continue;
         sbuf.used = 0;
-        string_buffer_append_printf(&sbuf, "[%s (%d", cData->channel->name, uData->access);
-        if(uData->flags != USER_AUTO_OP)
-            string_buffer_append(&sbuf, ',');
+        string_buffer_append_printf(&sbuf, "[%s (%d,", cData->channel->name, uData->access);
+        base_len = sbuf.used;
         if(IsUserSuspended(uData))
             string_buffer_append(&sbuf, 's');
         if(IsUserAutoOp(uData))
@@ -3911,6 +3911,8 @@ static CHANSERV_FUNC(cmd_myaccess)
         }
         if(IsUserAutoInvite(uData) && (uData->access >= cData->lvlOpts[lvlInviteMe]))
             string_buffer_append(&sbuf, 'i');
+        if(sbuf.used==base_len)
+            sbuf.used--;
         if(uData->info)
             string_buffer_append_printf(&sbuf, ")] %s", uData->info);
         else
@@ -5209,7 +5211,7 @@ chanserv_support_channels(void)
 static CHANSERV_FUNC(cmd_expire)
 {
     int channel_count = registered_channels;
-    expire_channels(NULL);
+    expire_channels(chanserv);
     reply("CSMSG_CHANNELS_EXPIRED", channel_count - registered_channels);
     return 1;
 }
index 6b260508c719b34922282b2568b72e69c5277aeb..78c7887e446827ba5ad20d9cb0f4b294daf27fcf 100644 (file)
@@ -230,8 +230,7 @@ memoserv_can_send(struct userNode *bot, struct userNode *user, struct memo_accou
     if (!(account->flags & MEMO_DENY_NONCHANNEL))
         return 1;
     for (dest = account->handle->channels; dest; dest = dest->u_next) {
-        struct userData *recip = _GetChannelUser(dest->channel, user->handle_info, 1, 0);
-        if (recip != NULL && recip->seen != 0)
+        if (dest->seen && _GetChannelUser(dest->channel, user->handle_info, 1, 0))
             return 1;
     }
     send_message(user, bot, "MSMSG_CANNOT_SEND", account->handle->handle);