+void
+irc_mark(struct userNode *user, char *mark)
+{
+ char *host = user->hostname;
+ /* if the mark will put us over the host length, clip some off the left hand side
+ * to make room...
+ */
+ if(strlen(host) + 1 + strlen(mark) > HOSTLEN)
+ host += 1 + ( (strlen(host) + 1 + strlen(mark)) - HOSTLEN );
+ putsock("%s " CMD_MARK " %s DNSBL +m %s.%s", self->numeric, user->nick, mark, host);
+ putsock("%s " CMD_MARK " %s DNSBL_DATA %s", self->numeric, user->nick, mark);
+ /* If they are not otherwise marked, mark their host with fakehost */
+ if(!IsFakeHost(user) && !IsSetHost(user) && !IsHiddenHost(user))
+ {
+ struct modeNode *mn = NULL;
+ char fakehost[HOSTLEN];
+ unsigned int count = 0;
+ unsigned int n = 0;
+
+ putsock("%s " CMD_MODE " %s +x", self->numeric, user->nick);
+ putsock("%s " CMD_FAKEHOST " %s %s.%s", self->numeric, user->numeric, mark, host);
+
+ snprintf(fakehost, sizeof(fakehost), "%s.%s", mark, host);
+ safestrncpy(user->fakehost, fakehost, sizeof(user->fakehost));
+
+ for (n=count=0; n<user->channels.used; n++) {
+ mn = user->channels.list[n];
+ check_bans(user, mn->channel->name);
+ }
+ }
+}
+