- if (chptr && (member = find_member_link(chptr, sptr)))
- {
- if (IsZombie(member))
- {
- zombie = 1;
- flags = member->status & (CHFL_DEOPPED | CHFL_SERVOPOK);
- remove_user_from_channel(sptr, chptr);
- chptr = get_channel(sptr, name, CGT_CREATE);
- }
- else
- continue;
- }
- name = chptr->chname;
- if (!chptr->creationtime) /* A remote JOIN created this channel ? */
- chptr->creationtime = MAGIC_REMOTE_JOIN_TS;
- if (parc > 2)
- {
- if (chptr->creationtime == MAGIC_REMOTE_JOIN_TS)
- chptr->creationtime = atoi(keysOrTS);
- else
- parc = 2; /* Don't pass it on */
- }
- if (!zombie)
- {
- if (!MyConnect(sptr))
- flags = CHFL_DEOPPED;
- if (sptr->flags & FLAGS_TS8)
- flags |= CHFL_SERVOPOK;
- }
- if (MyConnect(sptr))
- {
- int created = chptr->users == 0;
- if (check_target_limit(sptr, chptr, chptr->chname, created))
- {
- if (created) /* Did we create the channel? */
- sub1_from_channel(chptr); /* Remove it again! */
- continue;
- }
- if ((i = can_join(sptr, chptr, keysOrTS)))
- {
- sendto_one(sptr, err_str(i), me.name, parv[0], chptr->chname);
- continue;
- }
- }
- /*
- * Complete user entry to the new channel (if any)
- */
- add_user_to_channel(chptr, sptr, flags);
-
- /*
- * Notify all other users on the new channel
- */
- sendto_channel_butserv(chptr, sptr, ":%s JOIN :%s", parv[0], name);
-
- if (MyUser(sptr))
- {
- del_invite(sptr, chptr);
- if (chptr->topic[0] != '\0')
- {
- sendto_one(sptr, rpl_str(RPL_TOPIC), me.name,
- parv[0], name, chptr->topic);
- sendto_one(sptr, rpl_str(RPL_TOPICWHOTIME), me.name, parv[0], name,
- chptr->topic_nick, chptr->topic_time);
- }
- parv[1] = name;
- m_names(cptr, sptr, 2, parv);
- }
+
+ }
+
+ name = chptr->chname;
+
+ if (!chptr->creationtime) /* A remote JOIN created this channel ? */
+ chptr->creationtime = MAGIC_REMOTE_JOIN_TS;
+
+ if (parc > 2)
+ {
+ if (chptr->creationtime == MAGIC_REMOTE_JOIN_TS)
+ chptr->creationtime = atoi(keysOrTS);
+ else
+ parc = 2; /* Don't pass it on */
+ }
+
+ if (!zombie)
+ {
+ if (sptr->flags & FLAGS_TS8)
+ flags |= CHFL_SERVOPOK;