Commits

Anonymous committed f865135

Allow /ojoin !#channel/%#channel, if admin/halfop are enabled.

Comments (0)

Files changed (3)

 Todo list for ShadowIRCd 6.1
 -----------------------------
-* update ojoin/omode/etc to use +ah
 * notice/message !#channel and %#channel
 * Add a disable_oper option to auth {} to not allow users in that auth block
   to use OPER.
                  Syntax: OACCEPT <nick>
 
 m_ojoin.c      - OJOIN - Join a channel through any modes or limits with 
-                         an optional status (@+)
+                         an optional status (!@%+)
                  Syntax: OJOIN [status]<channel>
 
 m_olist.c      - OLIST - Lists channels like LIST, but shows hidden
 		return 0;
 	}
 
-	if(*parv[1] == '@' || *parv[1] == '%' || *parv[1] == '+')
+	if(*parv[1] == '@' || *parv[1] == '%' || *parv[1] == '+' || *parv[1] == '!')
 	{
 		parv[1]++;
 		move_me = 1;
 			me.name, parv[1],
 			source_p->name, source_p->username, source_p->host);
 
-	if(*parv[1] == '@')
+	if(*parv[1] == '!' && ConfigChannel.use_admin)
+	{
+		add_user_to_channel(chptr, source_p, CHFL_ADMIN);
+		sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
+			      ":%s SJOIN %ld %s + :!%s",
+			      me.id, (long) chptr->channelts, chptr->chname, source_p->id);
+		sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN %s",
+				     source_p->name,
+				     source_p->username, source_p->host, chptr->chname);
+		sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +a %s",
+				     me.name, chptr->chname, source_p->name);
+
+	}
+	else if(*parv[1] == '@')
 	{
 		add_user_to_channel(chptr, source_p, CHFL_CHANOP);
 		sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
 				     me.name, chptr->chname, source_p->name);
 
 	}
+	else if(*parv[1] == '%' && ConfigChannel.use_halfop)
+	{
+		add_user_to_channel(chptr, source_p, CHFL_HALFOP);
+		sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
+			      ":%s SJOIN %ld %s + :%s%s",
+			      me.id, (long) chptr->channelts, chptr->chname, "%", source_p->id);
+		sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN %s",
+				     source_p->name,
+				     source_p->username, source_p->host, chptr->chname);
+		sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +h %s",
+				     me.name, chptr->chname, source_p->name);
+	}
 	else if(*parv[1] == '+')
 	{
 		add_user_to_channel(chptr, source_p, CHFL_VOICE);