home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / comm / Mail+News / UMS11 / rexx / CancelMsg.intui < prev    next >
Text File  |  1995-08-25  |  2KB  |  69 lines

  1. /*
  2.  
  3.    $VER: CancelMsg.intui 1.2 (25.8.95)
  4.  
  5.    Author:
  6.     Martin Koyro (mk@bones.westfalen.de)
  7.  
  8.    Function:
  9.     generates a cancel-msg for a usenetarticel.
  10.  
  11.    History:
  12.     1.0   initial version.
  13.     1.1   control-line is now quoted.
  14.     1.2   Asks if the message should be canceled.
  15.           The message will be deleted after the cancel is generated.
  16.  
  17.    Requires:
  18.     UMS, IntuiNews 1.3
  19.  
  20. */
  21.  
  22. Options results
  23.  
  24. Call Addlib('ums.library',0,-210,11)
  25. Call UMSInitConsts()
  26.  
  27. Status
  28. IF result ~= 'MESSAGE' THEN Exit 5
  29.  
  30. GetAccount
  31. OldAccount = Result
  32.  
  33. Account = UMSDupAccount(OldAccount)
  34.  
  35. GetMsgnum
  36. MsgNum = Result
  37.  
  38. Drop fields.
  39.  
  40. IF UMSReadMsgHeader(Account,msgnum,fields.,TRUE) THEN DO
  41.   IF Symbol('fields.UMSCODE_GROUP') = 'VAR' THEN DO
  42.  
  43.     IF UMSReadMsgInfo(Account,MsgNum,info.) THEN DO
  44.  
  45.       IF BitTst(info.USERSTAT,UMSUSTAT_OWNER) THEN DO
  46.  
  47.         'Request "CancelMsg" "**_Yes|No" "Cancel this message?"'
  48.         IF Result = 1 THEN DO
  49.  
  50.           Drop newmsg.
  51.  
  52.           newmsg.UMSCODE_MSGID    = "cancel" || "." || fields.UMSCODE_MSGID
  53.           newmsg.UMSCODE_GROUP    = fields.UMSCODE_GROUP
  54.           newmsg.UMSCODE_SUBJECT  = "cmsg cancel <" || fields.UMSCODE_MSGID || ">"
  55.           newmsg.UMSCODE_MSGTEXT  = "Please cancel this message!"
  56.           newmsg.UMSCODE_RFCATTR  = '"Control: cancel <' || fields.UMSCODE_MSGID || '>"'
  57.  
  58.           IF UMSWriteMsg(Account,newmsg.) ~= 0 THEN DO
  59.             'Request "CancelMsg" "**_OK" "Cancel generated!"'
  60.             IF ~UMSDeleteMsg(Account,msgnum) THEN 'Request "CancelMsg" "**_OK" "Can not delete message!"'
  61.           END
  62.         END
  63.       END; ELSE 'Request "CancelMsg" "**_OK" "You are not the owner of this message!"'
  64.     END
  65.   END
  66. END
  67.  
  68. UMSLogout(Account)
  69.