updates
authorPekka Riikonen <priikone@silcnet.org>
Mon, 22 Apr 2002 06:17:21 +0000 (06:17 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 22 Apr 2002 06:17:21 +0000 (06:17 +0000)
CHANGES
TODO
apps/irssi/docs/help/in/umode.in
apps/silcd/command.c
doc/Makefile.am.pre
doc/draft-riikonen-silc-commands-03.nroff
lib/silcclient/command.c
lib/silccore/silcmode.h

diff --git a/CHANGES b/CHANGES
index b3aecd1fcd24a68668089b55c79f8b5ed51bc60f..631a8f1b7f6048a07652a4af420918ed820995e7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Mon Apr 22 09:09:44 CEST 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * Added BLOCK_INVITE user mode to be able to block incoming
+         invite notifications.  Protoocol TODO #26.  Affected files
+         are lib/silccore/silcmode.h, lib/silcclient/command.c and
+         silcd/command.c.
+
 Sun Apr 21 19:44:38 EEST 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Disconnect Payload includes now the status type.  Updated
diff --git a/TODO b/TODO
index 6ce2572a4e28f4be5265e58df7c4e06ee9aad22e..0e6b17030de4f25568aa90bcd66da6ec5aa19e96 100644 (file)
--- a/TODO
+++ b/TODO
@@ -115,5 +115,5 @@ TODO in SILC Protocol
  24. Implement the <Requested Attributes> and the Attribute Payload to
      the core library, client and server.
 
- 26. INVITE notify blocking by mode? Quiet user mode to quiet a user on
-     channel, settable by chan op/founder?
+ 27. Quiet user mode to quiet a user on channel, settable by chan 
+     op/founder?
index 65de4ac443857e8b2eadf2ca289aaa3f20db6155..a1e96547aa360074dcab16aba35d3832cdfe4feb 100644 (file)
@@ -23,5 +23,7 @@ modes are available:
              This can be used to block unwanted private
              messages.
     w        Set/unset to reject anyone from watching you
+    I        Set/unset invitite blocking.  When set server
+             does not send invitie notifications to you
 
 See also: CMODE, CUMODE, AWAY
index 25df5eddead10cca6f40826c906f0d7fe4b7efe0..d6ea2115ba23050d8fa84a6fd39a15657e4b57d2 100644 (file)
@@ -2540,18 +2540,20 @@ SILC_SERVER_CMD_FUNC(invite)
     strncat(channel->invite_list, invite, len);
     strncat(channel->invite_list, ",", 1);
 
-    /* Send notify to the client that is invited to the channel */
-    idp = silc_id_payload_encode(channel_id, SILC_ID_CHANNEL);
-    idp2 = silc_id_payload_encode(sender->id, SILC_ID_CLIENT);
-    silc_server_send_notify_dest(server, dest_sock, FALSE, dest_id, 
-                                SILC_ID_CLIENT,
-                                SILC_NOTIFY_TYPE_INVITE, 3, 
-                                idp->data, idp->len, 
-                                channel->channel_name, 
-                                strlen(channel->channel_name),
-                                idp2->data, idp2->len);
-    silc_buffer_free(idp);
-    silc_buffer_free(idp2);
+    if (!(dest->mode & SILC_UMODE_BLOCK_INVITE)) {
+      /* Send notify to the client that is invited to the channel */
+      idp = silc_id_payload_encode(channel_id, SILC_ID_CHANNEL);
+      idp2 = silc_id_payload_encode(sender->id, SILC_ID_CLIENT);
+      silc_server_send_notify_dest(server, dest_sock, FALSE, dest_id, 
+                                  SILC_ID_CLIENT,
+                                  SILC_NOTIFY_TYPE_INVITE, 3, 
+                                  idp->data, idp->len, 
+                                  channel->channel_name, 
+                                  strlen(channel->channel_name),
+                                  idp2->data, idp2->len);
+      silc_buffer_free(idp);
+      silc_buffer_free(idp2);
+    }
   }
 
   /* Add the client to the invite list of the channel */
index 504b53ce0850316dbedb0644a1a71969c06185f4..8aac88cdcaef7feaf653dce5eab9caeba8e4861c 100644 (file)
@@ -29,7 +29,6 @@ all:
        touch draft-riikonen-silc-ke-auth-05.txt
        touch draft-riikonen-silc-commands-03.txt
        touch draft-riikonen-silc-flags-payloads-00.txt
-       -cd ..
 
 if SILC_DIST_CLIENT
 dist-hook:
index f5c6b311e81357fb7c254149746ad6207270155d..a03a07e825b0e4ed19fd622d436f0e2bb872f187 100644 (file)
@@ -1126,6 +1126,15 @@ List of all defined commands in SILC follows.
               certain users.  However, this document does not specify
               such service.
 
+
+           0x00001000    SILC_UMODE_BLOCK_INVITE
+
+              Marks that the client wishes to block incoming invite
+              notifications.  Client MAY set and unset this mode.
+              When set server does not deliver invite notifications
+              to the client.  Note that this mode may make it harder
+              to join invite-only channels.
+
         If the <client mode mask> was not provided this command merely
         returns the mode mask to the client.
 
index c70584a157e26e3b67dfc0628b0b903893087a43..fe1abaf0440b8f61d35b8e954f1420bfb1bac755 100644 (file)
@@ -1238,6 +1238,12 @@ SILC_CLIENT_CMD_FUNC(umode)
       else
        mode &= ~SILC_UMODE_REJECT_WATCHING;
       break;
+    case 'I':
+      if (add)
+       mode |= SILC_UMODE_BLOCK_INVITE;
+      else
+       mode &= ~SILC_UMODE_BLOCK_INVITE;
+      break;
     default:
       COMMAND_ERROR(SILC_STATUS_ERR_UNKNOWN_MODE);
       goto out;
index 2345ef611029c9df0b94db6ae313a7874554e353..ba246c129331d94f74a57b3846a2e938e57f3c27 100644 (file)
@@ -97,6 +97,7 @@
 #define SILC_UMODE_BLOCK_PRIVMSG     0x00000200 /* Client blocks privmsgs */
 #define SILC_UMODE_DETACHED          0x00000400 /* Client is detached */
 #define SILC_UMODE_REJECT_WATCHING   0x00000800 /* Client rejects watching */
+#define SILC_UMODE_BLOCK_INVITE      0x00001000 /* Client blocks invites */
 /***/
 
 #endif