- if (chjoin_rc == CHJOIN_WRONGPW && target == client && !client->isAdmin) {
- sendPermissionDenied(client, "Wrong channel password");
- break;
+ if (chjoin_rc == CHJOIN_WRONGPW) {
+ if (target == client && !client->isAdmin) {
+ sendPermissionDenied(client, "Wrong channel password");
+ break;
+ }
+ /* Tricky one: if user hasn't the password, but is moved to the channel by admin then let
+ * the user in. Also let admin user in regardless of channel password.
+ * Take no action on other errors.
+ */
+ else if (!client->isAdmin)
+ break;