Changeset 3757 for trunk/auto-reply
- Timestamp:
- 06/06/04 21:32:13 (4 years ago)
- Location:
- trunk/auto-reply/src
- Files:
-
- 2 modified
-
autoreply.cpp (modified) (6 diffs)
-
autoreply.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/auto-reply/src/autoreply.cpp
r3649 r3757 190 190 { 191 191 case SIGNAL_UPDATExUSER: 192 if (s->SubSignal() == USER_EVENTS && s->Uin() != gUserManager.OwnerUin()&& s->Argument() > 0)193 ProcessUserEvent(s-> Uin(), s->Argument());192 if (s->SubSignal() == USER_EVENTS && gUserManager.FindOwner(s->Id(), s->PPID()) == NULL && s->Argument() > 0) 193 ProcessUserEvent(s->Id(), s->PPID(), s->Argument()); 194 194 break; 195 195 // We should never get any other signal … … 224 224 225 225 226 void CLicqAutoReply::ProcessUserEvent( unsigned long nUin, unsigned long nId)227 { 228 ICQUser *u = gUserManager.FetchUser( nUin, LOCK_R);226 void CLicqAutoReply::ProcessUserEvent(const char *szId, unsigned long nPPID, unsigned long nId) 227 { 228 ICQUser *u = gUserManager.FetchUser(szId, nPPID, LOCK_R); 229 229 if (u == NULL) 230 230 { 231 gLog.Warn("%sInvalid u in received from daemon (%ld).\n", L_AUTOREPxSTR, nUin);231 gLog.Warn("%sInvalid user id received from daemon (%s).\n", L_AUTOREPxSTR, szId); 232 232 return; 233 233 } … … 242 242 else 243 243 { 244 bool r = AutoReplyEvent( nUin, e);244 bool r = AutoReplyEvent(szId, nPPID, e); 245 245 if (m_bDelete && r) 246 246 { 247 u = gUserManager.FetchUser( nUin, LOCK_W);247 u = gUserManager.FetchUser(szId, nPPID, LOCK_W); 248 248 u->EventClearId(nId); 249 249 gUserManager.DropUser(u); … … 253 253 254 254 255 bool CLicqAutoReply::AutoReplyEvent( unsigned long nUin, CUserEvent *event)255 bool CLicqAutoReply::AutoReplyEvent(const char *szId, unsigned long nPPID, CUserEvent *event) 256 256 { 257 257 char *szCommand; … … 259 259 char *tmp; 260 260 sprintf(buf, "%s ", m_szProgram); 261 ICQUser *u = gUserManager.FetchUser( nUin, LOCK_R);261 ICQUser *u = gUserManager.FetchUser(szId, nPPID, LOCK_R); 262 262 tmp = u->usprintf(m_szArguments); 263 263 gUserManager.DropUser(u); … … 299 299 char *szText = new char[4096 + 256]; 300 300 sprintf(szText, "%s", m_szMessage); 301 unsigned long tag = licqDaemon-> icqSendMessage(nUin, szText, !m_bSendThroughServer,301 unsigned long tag = licqDaemon->ProtoSendMessage(szId, nPPID, szText, !m_bSendThroughServer, 302 302 ICQ_TCPxMSG_URGENT); 303 303 delete []szText; 304 304 delete [] szCommand; 305 305 306 u = gUserManager.FetchUser( nUin, LOCK_R);306 u = gUserManager.FetchUser(szId, nPPID, LOCK_R); 307 307 if (u == NULL) return false; 308 308 309 309 if (tag == 0) 310 310 { 311 gLog.Warn("%sSending message to %s (% ld) failed.\n", L_AUTOREPxSTR,312 u->GetAlias(), nUin);311 gLog.Warn("%sSending message to %s (%s) failed.\n", L_AUTOREPxSTR, 312 u->GetAlias(), szId); 313 313 } 314 314 else 315 315 { 316 gLog.Info("%sSent autoreply to %s (% ld).\n", L_AUTOREPxSTR, u->GetAlias(),317 nUin);316 gLog.Info("%sSent autoreply to %s (%s).\n", L_AUTOREPxSTR, u->GetAlias(), 317 szId); 318 318 } 319 319 -
trunk/auto-reply/src/autoreply.h
r3649 r3757 38 38 void ProcessEvent(ICQEvent *); 39 39 40 void ProcessUserEvent( unsigned long, unsigned long);41 bool AutoReplyEvent( unsigned long, CUserEvent *);40 void ProcessUserEvent(const char *, unsigned long, unsigned long); 41 bool AutoReplyEvent(const char *, unsigned long, CUserEvent *); 42 42 43 43 bool POpen(const char *cmd);
