Changeset 203:71a5efcf776f
- Timestamp:
- 05/11/2008 07:13:57 PM (4 years ago)
- Author:
- Dmitry Nezhevenko <dion@…>
- Branch:
- default
- Message:
-
Forward "captcha" messages to bot owner
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r198
|
r203
|
|
| 114 | 114 | if (cmd=="JOIN" || cmd=="LEAVE" || cmd=="WHEREAMI") |
| 115 | 115 | return true; |
| | 116 | |
| | 117 | // Possible captcha request from conference server |
| | 118 | QString from=QString::fromStdString(s->from().full()); |
| | 119 | if (from.indexOf('@')<0 && from.indexOf('/') < 0) |
| | 120 | { |
| | 121 | return true; |
| | 122 | } |
| | 123 | |
| 116 | 124 | return false; |
| 117 | 125 | } |
| … |
… |
|
| 252 | 260 | if (parser.isForMe()) |
| 253 | 261 | { |
| | 262 | |
| | 263 | if (conf==0 && nickName.isEmpty()) |
| | 264 | { |
| | 265 | QString from=QString::fromStdString(s->from().full()).toLower(); |
| | 266 | if (from.indexOf('@')<0 && from.indexOf('/') < 0) |
| | 267 | { |
| | 268 | from=QString("@%1/").arg(from); |
| | 269 | for (QStringList::iterator it=confInProgress.begin(); it!=confInProgress.end(); ++it) |
| | 270 | { |
| | 271 | QString confName=*it; |
| | 272 | if (confName.toLower().indexOf(from)>0) |
| | 273 | { |
| | 274 | //Captcha request |
| | 275 | gloox::JID ownerJid(DataStorage::instance()->getStdString("access/owner")); |
| | 276 | gloox::Stanza *outgoing=gloox::Stanza::createMessageStanza(ownerJid,s->body()); |
| | 277 | bot()->client()->send(outgoing); |
| | 278 | return true; |
| | 279 | } |
| | 280 | } |
| | 281 | } |
| | 282 | } |
| | 283 | |
| 254 | 284 | if (cmd=="JOIN") |
| 255 | 285 | { |