From: Pekka Riikonen Date: Mon, 22 Apr 2002 06:17:21 +0000 (+0000) Subject: updates X-Git-Tag: 1.2.beta1~1399 X-Git-Url: http://git.silcnet.org/gitweb/?p=crypto.git;a=commitdiff_plain;h=d69c31dd76eb7216d41553885adcedec0beb4fc1 updates --- diff --git a/CHANGES b/CHANGES index b3aecd1f..631a8f1b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Mon Apr 22 09:09:44 CEST 2002 Pekka Riikonen + + * 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 * Disconnect Payload includes now the status type. Updated diff --git a/TODO b/TODO index 6ce2572a..0e6b1703 100644 --- a/TODO +++ b/TODO @@ -115,5 +115,5 @@ TODO in SILC Protocol 24. Implement the 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? diff --git a/apps/irssi/docs/help/in/umode.in b/apps/irssi/docs/help/in/umode.in index 65de4ac4..a1e96547 100644 --- a/apps/irssi/docs/help/in/umode.in +++ b/apps/irssi/docs/help/in/umode.in @@ -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 diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 25df5edd..d6ea2115 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -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 */ diff --git a/doc/Makefile.am.pre b/doc/Makefile.am.pre index 504b53ce..8aac88cd 100644 --- a/doc/Makefile.am.pre +++ b/doc/Makefile.am.pre @@ -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: diff --git a/doc/draft-riikonen-silc-commands-03.nroff b/doc/draft-riikonen-silc-commands-03.nroff index f5c6b311..a03a07e8 100644 --- a/doc/draft-riikonen-silc-commands-03.nroff +++ b/doc/draft-riikonen-silc-commands-03.nroff @@ -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 was not provided this command merely returns the mode mask to the client. diff --git a/lib/silcclient/command.c b/lib/silcclient/command.c index c70584a1..fe1abaf0 100644 --- a/lib/silcclient/command.c +++ b/lib/silcclient/command.c @@ -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; diff --git a/lib/silccore/silcmode.h b/lib/silccore/silcmode.h index 2345ef61..ba246c12 100644 --- a/lib/silccore/silcmode.h +++ b/lib/silccore/silcmode.h @@ -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