Started implementing protocol version 1.1 and narrowing down
[silc.git] / apps / silcd / server_util.c
index cc62e4caa38687032eeae7952dd2d01955fcb129..01870b9593dd545d81e6c7f0d18937bc3177c2f8 100644 (file)
@@ -924,6 +924,8 @@ bool silc_server_connection_allowed(SilcServer server,
   if (ske && silc_ske_parse_version(ske, &r_protocol_version, NULL,
                                    &r_software_version, NULL,
                                    &r_vendor_version)) {
+    sock->version = r_protocol_version;
+
     /* Match protocol version */
     if (l_protocol_version && r_protocol_version &&
        r_protocol_version < l_protocol_version) {
@@ -1054,6 +1056,28 @@ bool silc_server_check_cmode_rights(SilcServer server,
     }
   }
   
+  if (mode & SILC_CHANNEL_MODE_SILENCE_USERS) {
+    if (!(channel->mode & SILC_CHANNEL_MODE_SILENCE_USERS))
+      if (is_op && !is_fo)
+       return FALSE;
+  } else {
+    if (channel->mode & SILC_CHANNEL_MODE_SILENCE_USERS) {
+      if (is_op && !is_fo)
+       return FALSE;
+    }
+  }
+  
+  if (mode & SILC_CHANNEL_MODE_SILENCE_OPERS) {
+    if (!(channel->mode & SILC_CHANNEL_MODE_SILENCE_OPERS))
+      if (is_op && !is_fo)
+       return FALSE;
+  } else {
+    if (channel->mode & SILC_CHANNEL_MODE_SILENCE_OPERS) {
+      if (is_op && !is_fo)
+       return FALSE;
+    }
+  }
+  
   return TRUE;
 }