Permalink
Browse files

Added some testing methods to view the queue and trigger the batch job

  • Loading branch information...
1 parent e21aa05 commit 459d23264e5da7697a95fce429566c7e2474b36b @d0ugal d0ugal committed Nov 15, 2011
Showing with 18 additions and 2 deletions.
  1. +18 −2 mailer.cpp
View
@@ -180,6 +180,20 @@ class CMailer : public CModule {
CString message = "Testing";
MessagesList.push_front(message);
BatchSend();
+ } else if (action == "testshowqueue"){
+
+ list<CString>::iterator it;
+
+ CString message;
+
+ for ( it=MessagesList.begin() ; it != MessagesList.end(); it++ ){
+ DebugPrint(*it);
+ }
+
+ } else if (action == "testbatchsend"){
+
+ BatchSend();
+
}
}
@@ -191,6 +205,9 @@ class CMailer : public CModule {
CString message = "<" + location + ":" + Nick.GetNick() + "> " + sMessage + "\n\n";
MessagesList.push_front(message);
+ DebugPrint("Added message...");
+ DebugPrint(message);
+
if (MessagesList.size() > MaxNotifications){
MessagesList.pop_back();
}
@@ -259,11 +276,10 @@ class CMailer : public CModule {
return;
}
- DebugPrint(sMessage);
-
fprintf(email, "%s", (char*) sMessage.c_str());
pclose(email);
+ DebugPrint(sMessage);
DebugPrint("Sent");
}

0 comments on commit 459d232

Please sign in to comment.