This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
deb-goldedplus/golded3/gemsgid.cpp

58 lines
2.0 KiB
C++
Raw Normal View History

2003-03-26 16:12:22 +00:00
// ------------------------------------------------------------------
// GoldED+
// Copyright (C) 2003 Alexander Reznikov, 2:4600/220@fidonet,
// <homebrewer@yandex.ru>
// ------------------------------------------------------------------
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston,
// MA 02111-1307 USA
// ------------------------------------------------------------------
// $Id$
// ------------------------------------------------------------------
// Generate MSGID.
// ------------------------------------------------------------------
#include <golded.h>
#include <genmsgid.h>
// ------------------------------------------------------------------
static ulong msgcount = 0;
// ------------------------------------------------------------------
ulong getClassicMsgId() {
return time(NULL)+(msgcount++);
}
// ------------------------------------------------------------------
ulong getMsgId() {
ulong id;
char *err;
2003-04-03 14:20:58 +00:00
if(CFG->seqmsgid and not ((CFG->seqmsgid == MAYBE) and (*CFG->seqdir == NUL))) {
2003-03-26 16:12:22 +00:00
id = GenMsgIdEx(CFG->seqdir, CFG->seqoutrun, getClassicMsgId, &err);
if(err) {
LOG.printf("* Warning, SeqMsgId failed: %s, fall to classic algorythm!", err);
}
return id;
}
return getClassicMsgId();
}
// ------------------------------------------------------------------