Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XMXANSER

XMXANSER.m

Go to the documentation of this file.
  1. XMXANSER ;ISC-SF/GMB-Answer a msg ;04/24/2002 10:08
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ; Replaces ^XMA11A (ISC-WASH/CAP/THM)
  1. ; XMDUZ DUZ of who the msg is from
  1. ; XMSUBJ Subject of the msg (defaults to 'Re:' original subject)
  1. ; XMBODY Closed root of Body of the msg
  1. ; Must be closed root, passed by value. See WP_ROOT
  1. ; definition for WP^DIE(), FM word processing filer.
  1. ; XMTO Additional addressees, besides msg originator
  1. ; XMINSTR("FROM") String saying from whom (default is user)
  1. ; XMINSTR("SELF BSKT") Basket to deliver to if sender is recipient
  1. ; XMINSTR("SHARE BSKT") Basket to deliver to if recipient is "SHARED,MAIL"
  1. ; XMINSTR("SHARE DATE") Delete date if recipient is "SHARED,MAIL"
  1. ; XMINSTR("RCPT BSKT") Basket name (only) to deliver to for other recipients
  1. ; XMINSTR("VAPOR") Date on which to vaporize (delete) this message
  1. ; from recipient baskets
  1. ; XMINSTR("LATER") Date on which to send this msg, if not now
  1. ; XMINSTR("FLAGS") Any or all of the following:
  1. ; P Priority
  1. ; I Information only (may not be replied to)
  1. ; X Closed msg (may not be forwarded)
  1. ; C Confidential (surrogates may not read)
  1. ; S Send to sender (make sender a recipient)
  1. ; R Confirm receipt
  1. ; XMINSTR("SCR KEY") Scramble key (implies that msg should be scrambled)
  1. ; XMINSTR("SCR HINT") Hint (to guess the scramble key)
  1. ; XMINSTR("KEYS") List of keys needed by recipient to read msg (NOT IMPLEMENTED)
  1. ; XMINSTR("TYPE") Msg type is one of the following:
  1. ; D Document
  1. ; S Spooled Document
  1. ; X DIFROM
  1. ; O ODIF
  1. ; B BLOB
  1. ; K KIDS
  1. ;
  1. ; Output:
  1. ; XMZR The number of the message containing the answer.
  1. ANSRMSG(XMDUZ,XMK,XMKZ,XMSUBJ,XMBODY,XMTO,XMINSTR,XMZR) ;
  1. N XMZ,XMZREC,XMZSENDR
  1. K XMERR,^TMP("XMERR",$J)
  1. D CHKMSG^XMXSEC1(XMDUZ,.XMK,.XMKZ,.XMZ,.XMZREC) Q:$D(XMERR)
  1. Q:'$$ANSWER^XMXSEC(XMDUZ,XMZ,XMZREC)
  1. S:$G(XMSUBJ)="" XMSUBJ=$E($$EZBLD^DIALOG(37006)_$P(XMZREC,U,1),1,65) ; Re:
  1. D CRE8XMZ^XMXSEND(XMSUBJ,.XMZR) Q:$D(XMERR)
  1. S XMZSENDR=$P(XMZREC,U,2)
  1. S:XMZSENDR["@" XMZSENDR=$$REPLYTO1^XMXREPLY(XMZ)
  1. D COMPOSE(XMDUZ,XMZ,$P(XMZREC,U,1),XMZSENDR,$P(XMZREC,U,3),XMZR,XMBODY)
  1. S XMTO(XMZSENDR)=""
  1. S XMINSTR("EXACT")=1 ; Match on exact domain name
  1. D ADDRNSND^XMXSEND(XMDUZ,XMZR,.XMTO,.XMINSTR)
  1. K XMINSTR("EXACT")
  1. Q
  1. COMPOSE(XMDUZ,XMZ,XMZSUBJ,XMZSENDR,XMZDATE,XMZR,XMBODY) ;
  1. D COPY(XMZ,XMZSUBJ,XMZSENDR,XMZDATE,XMZR)
  1. ; File XMBODY, with the "append" option
  1. D MOVEBODY^XMXSEND(XMZR,XMBODY,"A") ; Put the msg body in place
  1. D NETSIG^XMXEDIT(XMDUZ,XMZR)
  1. Q
  1. COPY(XMZO,XMZOSUBJ,XMZOFROM,XMZODATE,XMZ) ; Copy the original msg, putting ">" in front of each line.
  1. N I,J
  1. D COPYHEAD^XMJMC(XMZO,XMZOSUBJ,XMZOFROM,XMZODATE,XMZ,"A",.J)
  1. S J=J+1,^XMB(3.9,XMZ,2,J,0)=">"
  1. S I=.999999
  1. F S I=$O(^XMB(3.9,XMZO,2,I)) Q:I="" S J=J+1,^XMB(3.9,XMZ,2,J,0)=$E(">"_^(I,0),1,254)
  1. S J=J+1,^XMB(3.9,XMZ,2,J,0)=""
  1. S J=J+1,^XMB(3.9,XMZ,2,J,0)=""
  1. S ^XMB(3.9,XMZ,2,0)="^3.92A^"_J_U_J_U_DT
  1. Q