Fix which userData is checked for deny-nonchannel memo sending.
authorMichael Poole <mdpoole@troilus.org>
Mon, 31 Oct 2011 04:12:34 +0000 (00:12 -0400)
committerMichael Poole <mdpoole@troilus.org>
Mon, 31 Oct 2011 04:12:34 +0000 (00:12 -0400)
Fixes SourceForge bug #3308832.

src/mod-memoserv.c (memoserv_can_send): Require the recipient to have
    joined a channel for their membership there to count as common
    with the sender.  (This was the original intent.)

src/mod-memoserv.c

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);