Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Session::privCmd_rubbish(const QXmppMessage &msg)
- {
- RubbishPeer *rp;
- foreach(rp, rubbishPeers)
- {
- if (rp->jid == msg.from())
- {
- if (rp->timer.isActive())
- {
- if (!rp->insistent)
- {
- emit sendMessage(msg.from(), "ENGLISH, MOTHERFUCKER!!! DO YOU SPEAK IT?!?");
- rp->timer.stop();
- rp->timer.start(0);
- rp->insistent = true;
- }
- else
- {
- rp->timer.stop();
- rp->timer.setInterval(60000);
- rp->timer.start(0);
- }
- return;
- }
- else
- {
- rubbishPeers.removeOne(rp);
- delete rp;
- }
- }
- }
- emit sendMessage(msg.from(), "Ayyyye... I cannot understand what you want from me! Say \"help\" for available commands!");
- rp = new RubbishPeer();
- rp->jid = msg.from();
- rp->insistent = false;
- rp->timer.setInterval(10000);
- QObject::connect(&rp->timer, SIGNAL(timeout()), &rp->timer, SLOT(stop()));
- rp->timer.start();
- rubbishPeers << rp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement