|
|
|
@ -20,9 +20,7 @@ public:
|
|
|
|
bool op;
|
|
|
|
bool op;
|
|
|
|
unsigned int usn;
|
|
|
|
unsigned int usn;
|
|
|
|
|
|
|
|
|
|
|
|
IRCDDBAppUserObject() {
|
|
|
|
IRCDDBAppUserObject() {}
|
|
|
|
// IRCDDBAppUserObject ("", "", "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IRCDDBAppUserObject(const std::string &n, const std::string &nm, const std::string &h) {
|
|
|
|
IRCDDBAppUserObject(const std::string &n, const std::string &nm, const std::string &h) {
|
|
|
|
nick = n;
|
|
|
|
nick = n;
|
|
|
|
@ -311,9 +309,6 @@ void IRCDDBApp::userJoin(const std::string &nick, const std::string &name, const
|
|
|
|
//traceit("user %d\n", u.usn);
|
|
|
|
//traceit("user %d\n", u.usn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IRCDDBApp::userLeave(const std::string &nick)
|
|
|
|
void IRCDDBApp::userLeave(const std::string &nick)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string lnick = nick;
|
|
|
|
std::string lnick = nick;
|
|
|
|
@ -466,7 +461,6 @@ std::string IRCDDBApp::getIPAddress(std::string &zonerp_cs)
|
|
|
|
return ipAddr;
|
|
|
|
return ipAddr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool IRCDDBApp::findGateway(const std::string &gwCall)
|
|
|
|
bool IRCDDBApp::findGateway(const std::string &gwCall)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string s = gwCall.substr(0,6);
|
|
|
|
std::string s = gwCall.substr(0,6);
|
|
|
|
@ -546,12 +540,16 @@ bool IRCDDBApp::findRepeater(const std::string &rptrCall)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool IRCDDBApp::sendHeard(const std::string &myCall,
|
|
|
|
bool IRCDDBApp::sendHeard(const std::string &myCall, const std::string &myCallExt,
|
|
|
|
const std::string &myCallExt,
|
|
|
|
const std::string &yourCall, const std::string &rpt1,
|
|
|
|
const std::string &yourCall,
|
|
|
|
const std::string &rpt2, unsigned char flag1,
|
|
|
|
const std::string &rpt1,
|
|
|
|
unsigned char flag2, unsigned char flag3,
|
|
|
|
const std::string &rpt2,
|
|
|
|
const std::string &destination, const std::string &tx_msg,
|
|
|
|
unsigned char flag1,
|
|
|
|
|
|
|
|
unsigned char flag2,
|
|
|
|
|
|
|
|
unsigned char flag3,
|
|
|
|
|
|
|
|
const std::string &destination,
|
|
|
|
|
|
|
|
const std::string &tx_msg,
|
|
|
|
const std::string &tx_stats)
|
|
|
|
const std::string &tx_stats)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
@ -657,7 +655,6 @@ bool IRCDDBApp::findUser(const std::string &usrCall)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IRCDDBApp::msgChannel(IRCMessage *m)
|
|
|
|
void IRCDDBApp::msgChannel(IRCMessage *m)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (0==m->getPrefixNick().compare(0, 2, "s-") && (m->numParams >= 2)) { // server msg
|
|
|
|
if (0==m->getPrefixNick().compare(0, 2, "s-") && (m->numParams >= 2)) { // server msg
|
|
|
|
@ -665,7 +662,6 @@ void IRCDDBApp::msgChannel(IRCMessage *m)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IRCDDBApp::doNotFound(std::string &msg, std::string &retval)
|
|
|
|
void IRCDDBApp::doNotFound(std::string &msg, std::string &retval)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int tableID = 0;
|
|
|
|
int tableID = 0;
|
|
|
|
@ -818,7 +814,6 @@ void IRCDDBApp::doUpdate(std::string &msg)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static std::string getTableIDString(int tableID, bool spaceBeforeNumber)
|
|
|
|
static std::string getTableIDString(int tableID, bool spaceBeforeNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (tableID == 0) {
|
|
|
|
if (tableID == 0) {
|
|
|
|
@ -834,7 +829,6 @@ static std::string getTableIDString(int tableID, bool spaceBeforeNumber)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IRCDDBApp::msgQuery(IRCMessage *m)
|
|
|
|
void IRCDDBApp::msgQuery(IRCMessage *m)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
@ -891,7 +885,6 @@ void IRCDDBApp::msgQuery(IRCMessage *m)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IRCDDBApp::setSendQ(IRCMessageQueue *s)
|
|
|
|
void IRCDDBApp::setSendQ(IRCMessageQueue *s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->sendQ = s;
|
|
|
|
d->sendQ = s;
|
|
|
|
@ -902,7 +895,6 @@ IRCMessageQueue *IRCDDBApp::getSendQ()
|
|
|
|
return d->sendQ;
|
|
|
|
return d->sendQ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static std::string getLastEntryTime(int tableID)
|
|
|
|
static std::string getLastEntryTime(int tableID)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
@ -917,16 +909,8 @@ static std::string getLastEntryTime(int tableID)
|
|
|
|
return "DBERROR";
|
|
|
|
return "DBERROR";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool needsDatabaseUpdate(int tableID)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 1==tableID;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IRCDDBApp::Entry()
|
|
|
|
void IRCDDBApp::Entry()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
int sendlistTableID = 0;
|
|
|
|
int sendlistTableID = 0;
|
|
|
|
|
|
|
|
|
|
|
|
while (!d->terminateThread) {
|
|
|
|
while (!d->terminateThread) {
|
|
|
|
@ -991,7 +975,7 @@ void IRCDDBApp::Entry()
|
|
|
|
if (getSendQ() == NULL) {
|
|
|
|
if (getSendQ() == NULL) {
|
|
|
|
d->state = 10; // disconnect DB
|
|
|
|
d->state = 10; // disconnect DB
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (needsDatabaseUpdate(sendlistTableID)) {
|
|
|
|
if (1 == sendlistTableID) {
|
|
|
|
IRCMessage *m = new IRCMessage(d->currentServer, std::string("SENDLIST") + getTableIDString(sendlistTableID, true)
|
|
|
|
IRCMessage *m = new IRCMessage(d->currentServer, std::string("SENDLIST") + getTableIDString(sendlistTableID, true)
|
|
|
|
+ std::string(" ") + getLastEntryTime(sendlistTableID));
|
|
|
|
+ std::string(" ") + getLastEntryTime(sendlistTableID));
|
|
|
|
|
|
|
|
|
|
|
|
@ -1001,7 +985,7 @@ void IRCDDBApp::Entry()
|
|
|
|
|
|
|
|
|
|
|
|
d->state = 5; // wait for answers
|
|
|
|
d->state = 5; // wait for answers
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
d->state = 3; // don't send SENDLIST for this table, go to next table
|
|
|
|
d->state = 3; // don't send SENDLIST for this table (tableID 0), go to next table
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
@ -1122,7 +1106,3 @@ void IRCDDBApp::Entry()
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} // Entry()
|
|
|
|
} // Entry()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|