Skip to content

Commit 942be93

Browse files
committed
no longer leave defunct processes when cmd is run. don't reply to PM's with sending notice
1 parent 1151582 commit 942be93

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cmdnotify.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "znc/IRCNetwork.h"
1818
#include "znc/Modules.h"
1919
#include "time.h"
20+
#include "sys/wait.h"
2021

2122
using std::map;
2223
using std::string;
@@ -188,7 +189,9 @@ class CNotifoMod : public CModule
188189
/* and start executing pidgin..or w/e you want*/
189190
}
190191
else /* parent executes this */
191-
{ }
192+
{
193+
wait(NULL);
194+
}
192195
return true;
193196
}
194197

@@ -614,13 +617,15 @@ class CNotifoMod : public CModule
614617
CString msg = "From " + nick.GetNick();
615618
msg += ": " + message;
616619

617-
bool sent = send_message(msg, title, nick.GetNick());
620+
/*bool sent = send_message(msg, title, nick.GetNick());*/
621+
send_message(msg, title, nick.GetNick());
618622

619-
if (sent) {
623+
/** if (sent) {
620624
PutIRC("PRIVMSG " + nick.GetNick() + " : [znc] User not connected. Notification message sent.");
621625
} else {
622626
PutIRC("PRIVMSG " + nick.GetNick() + " : [znc] User not connected. Notification message failed to send.");
623627
}
628+
*/
624629
}
625630

626631
return CONTINUE;

0 commit comments

Comments
 (0)