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>
// ------------------------------------------------------------------
2005-10-20 21:41:32 +00:00
static uint32_t msgcount = 0;
2003-03-26 16:12:22 +00:00
// ------------------------------------------------------------------
2005-10-20 21:41:32 +00:00
uint32_t getClassicMsgId() {
2003-03-26 16:12:22 +00:00
2005-10-20 21:10:42 +00:00
return gtime(NULL)+(msgcount++);
2003-03-26 16:12:22 +00:00
}
// ------------------------------------------------------------------
2005-10-20 21:41:32 +00:00
uint32_t getMsgId() {
2003-03-26 16:12:22 +00:00
2005-10-20 21:41:32 +00:00
uint32_t id;
2003-03-26 16:12:22 +00:00
char *err;
if((CFG->seqmsgid == YES) or ((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();
}
// ------------------------------------------------------------------