;;; welcome.mhtml: -*- Meta-HTML -*- 
;;;
;;;  Copyright (c) 1996 Brian J. Fox
;;;  Author: Brian J. Fox (bfox@ai.mit.edu) Fri Aug 16 20:11:57 1996.
<set-var title="QuickTalk: The Meta-HTML Chat Room">
<include header.mhtml>

<make-innocuous posted>
<subst-in-var posted::handle "^[ \t\r\n]+" "" "[ \t\r\n]+$" "">

<when <or <get-var-once posted::action>
	  <get-var-once posted::handle>>>
  <when <get-var-once posted::handle>>
    ;;; Uncomment the following and edit it if you want to get mail when
    ;;; someone joins the chat room.
    <comment>
      <chat::notify chat@ua.com developers@ua.com
		    "Delevoper Chat has new member!"
		    <concat "<get-var-once posted::handle> has joined the"
			    " <get-var-once posted::room> room.">>
    </comment>
    <set-session-var chat::current-room=<get-var posted::room>>
    <set-session-var chat::user-agent=<get-var-once env::http_user_agent>>
    <set-var chat::current-room=<get-var posted::room>>
    <set-session-var chat::handle=<get-var-once posted::handle>>
    <set-var chat::handle=QUICKTALK>
    <set-session-var chat::last-comment=<time>>
    <chat::add-to-history "[<get-var handle> has joined us...]">
    <if <array-member <get-var-once posted::handle>
		      chat-internal::privileged-users>
	<set-session-var chat::privileged=true>>
    <redirect chat.mhtml>
  </when>

  <layout::page>
    <b>HEY!</b> You have to tell me what your handle is, so do it now!
  </layout::page>
</when>

<session-import chat chat>

<layout::page>
  <plain-text>
    <center>
      <h3>Welcome to <a href="info.mhtml"><quicktalk></a>, a chat room
      program written entirely in <meta-html>! </h3>

      <table>
	<tr>
	  <td align=right> <b>Implementation Start Date:</b> </td>
	  <td align=left> <i>Fri Aug 16 20:19:52 1996</i> </td>
	</tr>
	<tr>
	  <td align=right> <b>Implementation End Date:</b> </td>
	  <td align=left> <i>Fri Aug 16 21:45:55 1996</i> </td>
	</tr>
      </table>

      <h3> Today is <i><date></i> </h3>
    </center>

    Welcome to <quicktalk>, your communication center!

    Currently there are no set times for our developers to be logged in,
    but we work strange hours, so why not try sending us something?  You
    might be pleasantly surprised!  Or, tell a friend and start your own
    thread.

    Anyway enter your name, and start chatting!

    <center>
      <form method=post action="<thisdoc>">
	<table>
	  <tr>
	    <td align=right> <b>Your "handle":</b> </td>
	    <td align=left>
	      <input type=text size=15 name=handle
	      value="<get-var-once chat::handle>">
	      <input type=submit name=action value="QuickTalk!">
	    </td>
	  </tr>
	  <chat::select-room>
	</table>
      </form>
    </center>
  </plain-text>
</layout::page>

<include footer.mhtml>
