+static bool
+chm_regmsg_test(struct Client *source_p, struct Channel *chptr)
+{
+ struct membership *msptr;
+
+ /* mode is unset, accept */
+ if (!(chptr->mode.mode & mode_regmsg))
+ return true;
+
+ /* user is identified, accept */
+ if (!EmptyString(source_p->user->suser))
+ return true;
+
+ /* voice and op override identification requirement, accept */
+ msptr = find_channel_membership(chptr, source_p);
+ if (is_chanop_voiced(msptr))
+ return true;
+
+ return false;
+}
+