# chat_sec.src

# Chat Section for any/all Synchronet command shells

# Requires v3.00g or later

!include sbbsdefs.inc

compare_ars rest C
if_true
    print "\r\nYou can't chat.\r\n"
    return
    end_if

# Set return point for main menu commands (via end_cmd)
cmd_home

# Display TEXT\MENU\CHAT.* if not in expert mode
compare_user_misc UM_EXPERT
if_false
	menu chat
	end_if

# Update node status
node_action node_chat
async
print "\r\n\1_\1y\1hChat: \1n"
getcmd "ACDFIJPQRST?\r"
cmdkey 'S'
	TOGGLE_USER_CHAT CHAT_SPLITP
	printf "\1n\r\nPrivate split-screen chat is now: \1h"
	COMPARE_USER_CHAT CHAT_SPLITP
	if_true
		print "ON\1n"
	else
		print "OFF\1n"
		end_if
	crlf
	end_cmd

cmdkey 'A'
	crlf
	toggle_user_chat CHAT_NOACT
	toggle_node_misc NODE_AOFF
	nodelist_users
	end_cmd

cmdkey 'D'
	crlf
	toggle_user_chat CHAT_NOPAGE
	toggle_node_misc NODE_POFF
	nodelist_users
	end_cmd

cmdkey 'F'
	crlf
	exec "?finger"
	end_cmd

cmdkey 'I'
	crlf
	exec "?sbbsimsg"
	end_cmd

cmdkey 'R'
	crlf
	print "\1n\1y\1hServer and channel: "
	setstr "irc.synchro.net 6667 #Synchronet"
	getstr str 50 K_EDIT|K_LINE|K_AUTODEL
	if_true
		exec "?irc -a %s"
		end_if
	end_cmd

cmdkey 'J'
	multinode_chat
	end_cmd

cmdkey 'P'
	private_chat
	end_cmd

cmdkey 'C'
	page_sysop
	if_false
		page_guru
		end_if
	end_cmd

cmdkey 'T'
	page_guru
	end_cmd

cmdkey '?'
	compare_user_misc UM_EXPERT
	if_true
		menu "chat"
		end_if
	end_cmd

cmd_pop
return