Index: autoreply.cpp =================================================================== RCS file: /cvsroot/licq/auto-reply/src/autoreply.cpp,v retrieving revision 1.17 diff -u -r1.17 autoreply.cpp --- autoreply.cpp 26 Jan 2004 17:47:48 -0000 1.17 +++ autoreply.cpp 6 Jun 2004 02:03:49 -0000 @@ -189,8 +189,8 @@ switch (s->Signal()) { case SIGNAL_UPDATExUSER: - if (s->SubSignal() == USER_EVENTS && s->Uin() != gUserManager.OwnerUin() && s->Argument() > 0) - ProcessUserEvent(s->Uin(), s->Argument()); + if (s->SubSignal() == USER_EVENTS && gUserManager.FindOwner(s->Id(), s->PPID()) == NULL && s->Argument() > 0) + ProcessUserEvent(s->Id(), s->PPID(), s->Argument()); break; // We should never get any other signal default: @@ -223,12 +223,12 @@ } -void CLicqAutoReply::ProcessUserEvent(unsigned long nUin, unsigned long nId) +void CLicqAutoReply::ProcessUserEvent(const char *szId, unsigned long nPPID, unsigned long nId) { - ICQUser *u = gUserManager.FetchUser(nUin, LOCK_R); + ICQUser *u = gUserManager.FetchUser(szId, nPPID, LOCK_R); if (u == NULL) { - gLog.Warn("%sInvalid uin received from daemon (%ld).\n", L_AUTOREPxSTR, nUin); + gLog.Warn("%sInvalid user id received from daemon (%s).\n", L_AUTOREPxSTR, szId); return; } @@ -241,10 +241,10 @@ } else { - bool r = AutoReplyEvent(nUin, e); + bool r = AutoReplyEvent(szId, nPPID, e); if (m_bDelete && r) { - u = gUserManager.FetchUser(nUin, LOCK_W); + u = gUserManager.FetchUser(szId, nPPID, LOCK_W); u->EventClearId(nId); gUserManager.DropUser(u); } @@ -252,13 +252,13 @@ } -bool CLicqAutoReply::AutoReplyEvent(unsigned long nUin, CUserEvent *event) +bool CLicqAutoReply::AutoReplyEvent(const char *szId, unsigned long nPPID, CUserEvent *event) { char *szCommand; char buf[4096]; char *tmp; sprintf(buf, "%s ", m_szProgram); - ICQUser *u = gUserManager.FetchUser(nUin, LOCK_R); + ICQUser *u = gUserManager.FetchUser(szId, nPPID, LOCK_R); tmp = u->usprintf(m_szArguments); gUserManager.DropUser(u); szCommand = new char[strlen(buf) + strlen(tmp) + 1]; @@ -298,23 +298,23 @@ char *szText = new char[4096 + 256]; sprintf(szText, "%s", m_szMessage); - unsigned long tag = licqDaemon->icqSendMessage(nUin, szText, !m_bSendThroughServer, + unsigned long tag = licqDaemon->ProtoSendMessage(szId, nPPID, szText, !m_bSendThroughServer, ICQ_TCPxMSG_URGENT); delete []szText; delete [] szCommand; - u = gUserManager.FetchUser(nUin, LOCK_R); + u = gUserManager.FetchUser(szId, nPPID, LOCK_R); if (u == NULL) return false; if (tag == 0) { - gLog.Warn("%sSending message to %s (%ld) failed.\n", L_AUTOREPxSTR, - u->GetAlias(), nUin); + gLog.Warn("%sSending message to %s (%s) failed.\n", L_AUTOREPxSTR, + u->GetAlias(), szId); } else { - gLog.Info("%sSent autoreply to %s (%ld).\n", L_AUTOREPxSTR, u->GetAlias(), - nUin); + gLog.Info("%sSent autoreply to %s (%s).\n", L_AUTOREPxSTR, u->GetAlias(), + szId); } gUserManager.DropUser(u); Index: autoreply.h =================================================================== RCS file: /cvsroot/licq/auto-reply/src/autoreply.h,v retrieving revision 1.7 diff -u -r1.7 autoreply.h --- autoreply.h 26 Jan 2004 17:47:48 -0000 1.7 +++ autoreply.h 6 Jun 2004 02:03:49 -0000 @@ -37,8 +37,8 @@ void ProcessSignal(CICQSignal *); void ProcessEvent(ICQEvent *); - void ProcessUserEvent(unsigned long, unsigned long); - bool AutoReplyEvent(unsigned long, CUserEvent *); + void ProcessUserEvent(const char *, unsigned long, unsigned long); + bool AutoReplyEvent(const char *, unsigned long, CUserEvent *); bool POpen(const char *cmd); int PClose();
Here's a patch for the autoreply plugin to work with other protocols
(tested with msn, works)
- Re: [Licq-devel] autoreply update Philip Nelson
- Re: [Licq-devel] autoreply update Jon Keating