** Set all absolutely all conf tags like original conf?
** What if original is EMail?
**
*/
options results
options failat 31
parse arg arguments
/*
** Initialize some variables
*/
version = subword(sourceline(2), 4, 1)
returned = 0; progwin = 0
CDB_MARK_OWN_MSGS = 22 /* Also mark messages from user when adding messages. */
CDF_NOT_ON_BBS = '00008000'x /* This conference is not on the bbs. */
CDNT_NONET = 0 /* This conference is a local conference. This is the default values for new conferences. */
CDNT_MAILFOLDER = 3 /* This conference is a virtual mail folder */
MDB_READ = 0 /* Message is read. */
MDB_REPLIED = 1 /* Message is replied. */
MDB_PRIVATE = 2 /* Message is private. */
MDB_DELETED = 5 /* Message is deleted. */
MDB_KEEP = 7 /* Keep message. Message will not be deleted during conference packing. */
MDB_MARKED = 10 /* Message is marked. */
MDB_URGENT = 11 /* Message is urgent. */
MDB_IMPORTANT = 12 /* Message is important. */
MDB_SUPERMARKED = 13 /* Message will not be unmarked as long as this flag is set. */
MDB_CONFIDENTIAL = 17 /* Message is confidential. */
/*
** Check for Thor's ARexx port
*/
thorport = address()
if (left(thorport, 5) ~= 'THOR.') then do
say 'CopyMessages.thor can only be run from within Thor.'
exit(0)
end
/*
** Find/open BBSREAD ARexx port
*/
if ~(show('P', 'BBSREAD')) then do
address(command)
'Run >NIL: `GetEnv THOR/THORPath`bin/LoadBBSRead'
'WaitForPort BBSREAD'
if (rc ~= 0) then do
say 'Could not find BBSRead''s ARexx port.'
exit(20)
end
end
/*
** Utilize BBSRead's copyback buffer
*/
address(bbsread)
'BUFMODE COPYBACK'
/*
** Get system and conference names
*/
nosys = 0
address(thorport)
'CURRENTSYSTEM 'cursys
if (rc = 1) then nosys = 1
else if (rc ~= 0) then signal error
if (nosys) | (cursys.CONFNAME = '') then do
'REQUESTNOTIFY "No current system or conference.\n\nPlease make sure you have entered\na conference in Thor and selected\nmessages to copy before running\nCopyMessages." "Ok"'
signal cleanup
end
drop nosys
/*
** Build msglist stem
*/
address(thorport)
'GETMSGLISTSELECTED STEM 'msglist
if (rc = 3) then do
'CURRENTMSG 'curmsg
if (rc = 30) & (THOR.LASTERROR = 'No current message.') then msglist.count = 0
else if (rc ~= 0) then signal error
else do
msglist.1 = curmsg.MSGNR; msglist.count = 1; drop curmsg.
end
end
else if (rc ~= 0) then signal error
if (msglist.count = 0) then do
'REQUESTNOTIFY "No current or multiselected messages.\n\nMake sure you either have a current message\nor have multiselected some messages before\nrunning CopyMessages.thor." "Ok"'
signal cleanup
end
/*
** Get destination system and conference
*/
address(bbsread)
'GETBBSLIST STEM 'bbslist
if (rc ~= 0) then signal error
if (bbslist.COUNT = 0) then do
address(thorport)
'REQUESTNOTIFY "No available systems!" "That''s odd"'
signal cleanup
end
address(thorport)
'REQUESTLIST INSTEM 'bbslist' TITLE "Copy to system" SIZEGADGET'
if (rc = 5) then signal cleanup
else if (rc ~= 0) then signal error
destsys = result
address(bbsread)
'GETCONFLIST BBSNAME "'destsys'" STEM 'conflist
if (rc ~= 0) then signal error
menulist.1 = 'Create new conference'
menulist.2 = ''
do i = 1 to conflist.count
mcnt = i + 2; menulist.mcnt = conflist.i
end
menulist.count = i + 1
address(thorport)
'REQUESTLIST INSTEM 'menulist' TITLE "Copy to conference" SIZEGADGET'
if (rc = 5) then signal cleanup
else if (rc ~= 0) then signal error
destconf = result
if (destconf = 'Create new conference') then do
address(thorport)
'REQUESTSTRING TITLE "Destination conference" BODY "Enter name of new conference" BT "Ok|Cancel"'