summaryrefslogtreecommitdiffstats
path: root/ksirc/ioNotify.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /ksirc/ioNotify.cpp
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/ioNotify.cpp')
-rw-r--r--ksirc/ioNotify.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/ksirc/ioNotify.cpp b/ksirc/ioNotify.cpp
new file mode 100644
index 00000000..14c6e9e8
--- /dev/null
+++ b/ksirc/ioNotify.cpp
@@ -0,0 +1,75 @@
+/**********************************************************************
+
+ IO Notify Messanger
+
+ $$Id$$
+
+**********************************************************************/
+
+#include "ioNotify.h"
+#include "ksircprocess.h"
+
+#include <kdebug.h>
+
+KSircIONotify::KSircIONotify(KSircProcess *_proc)
+ : QObject(),
+ KSircMessageReceiver(_proc)
+{
+ proc = _proc;
+ setBroadcast(FALSE);
+}
+
+
+KSircIONotify::~KSircIONotify()
+{
+}
+
+void KSircIONotify::sirc_receive(QCString str, bool)
+{
+ if(str.contains("*)*")){
+ int s1, s2;
+ s1 = str.find("Signon by") + 10;
+ s2 = str.find(" ", s1);
+ if(s1 < 0 || s2 < 0){
+ kdDebug(5008) << "Nick Notify mesage broken: " << str << endl;
+ return;
+ }
+ QString nick = str.mid(s1, s2 - s1);
+ emit notify_online(nick);
+ }
+ else if(str.contains("*(*")){
+ int s1, s2;
+ s1 = str.find("Signoff by") + 11;
+ s2 = str.find(" ", s1);
+ if(s1 < 0 || s2 < 0){
+ kdDebug(5008) << "Nick Notify mesage broken: " << str << endl;
+ return;
+ }
+ QString nick = str.mid(s1, s2 - s1);
+ emit notify_offline(nick);
+ }
+ else{
+ proc->getWindowList()["!default"]->sirc_receive(str);
+ kdDebug(5008) << "Nick Notifer got " << str << endl;
+ }
+}
+
+void KSircIONotify::control_message(int, QString)
+{
+}
+
+
+filterRuleList *KSircIONotify::defaultRules()
+{
+ filterRule *fr;
+ filterRuleList *frl = new filterRuleList();
+ frl->setAutoDelete(TRUE);
+ fr = new filterRule();
+ fr->desc = "Send Nick Notifies to notifier parser";
+ fr->search = "^\\*\\S?[\\(\\)]\\S?\\* ";
+ fr->from = "^";
+ fr->to = "~!notify~";
+ frl->append(fr);
+ return frl;
+}
+#include "ioNotify.moc"