Changeset 285:10935f0d6ff7
- Timestamp:
- 06/22/2008 11:47:45 AM (4 years ago)
- Author:
- Dmitry Nezhevenko <dion@…>
- Branch:
- default
- Message:
-
Avoid autoleave for some conferences. No interface yet
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r280
|
r285
|
|
| 95 | 95 | `online` tinyint(1) NOT NULL default '0', |
| 96 | 96 | `joined` datetime default NULL, |
| | 97 | `autoleave` tinyint(1) NOT NULL default '1', |
| | 98 | `owner` varchar(200) NULL, |
| 97 | 99 | PRIMARY KEY (`name`), |
| 98 | 100 | UNIQUE KEY `id` (`id`) |
-
|
r280
|
r285
|
|
| 53 | 53 | online boolean NOT NULL default false, |
| 54 | 54 | joined timestamp default NULL, |
| | 55 | autoleave boolean NOT NULL default true, |
| | 56 | owner varchar(200) NULL, |
| 55 | 57 | PRIMARY KEY (name), |
| 56 | 58 | UNIQUE (id) |
-
|
r274
|
r285
|
|
| 90 | 90 | if (!myLazyLeave) |
| 91 | 91 | { |
| 92 | | QSqlQuery query=DataStorage::instance() |
| 93 | | ->prepareQuery("UPDATE conferences SET online = false WHERE id = ?"); |
| 94 | | query.addBindValue(myId); |
| 95 | | query.exec(); |
| | 92 | markOffline(); |
| 96 | 93 | } |
| 97 | 94 | else |
| … |
… |
|
| 105 | 102 | delete myCommand; |
| 106 | 103 | delete configurator_; |
| | 104 | } |
| | 105 | |
| | 106 | void Conference::markOffline() |
| | 107 | { |
| | 108 | QSqlQuery query=DataStorage::instance() |
| | 109 | ->prepareQuery("UPDATE conferences SET online = false WHERE id = ?"); |
| | 110 | query.addBindValue(myId); |
| | 111 | query.exec(); |
| 107 | 112 | } |
| 108 | 113 | |
| … |
… |
|
| 262 | 267 | " where conference_nicks.conference_id=conferences.id and" |
| 263 | 268 | " lastaction > ?) as cnt" |
| 264 | | " from conferences where autojoin=true and online=true order by cnt"); |
| | 269 | " from conferences where autojoin=true and online=true and autoleave=true order by cnt"); |
| 265 | 270 | QDateTime currentDate=QDateTime::currentDateTime(); |
| 266 | 271 | currentDate=currentDate.addSecs(-deltaTime); |
-
|
r274
|
r285
|
|
| 41 | 41 | void loadOnlineNicks(); |
| 42 | 42 | void cleanNonValidNicks(); |
| | 43 | void markOffline(); |
| 43 | 44 | |
| 44 | 45 | MucConfigurator* configurator() const { return configurator_; } |
-
|
r284
|
r285
|
|
| 374 | 374 | } |
| 375 | 375 | reply(s, "Ok"); |
| | 376 | //!!!!!!!!!!!!!!!!!!!! |
| 376 | 377 | join(arg); |
| 377 | 378 | return true; |
| … |
… |
|
| 825 | 826 | } |
| 826 | 827 | |
| 827 | | void MucPlugin::join(const QString& name) |
| | 828 | void MucPlugin::join(const QString& name, const QString& joinerBareJid) |
| 828 | 829 | { |
| 829 | 830 | qDebug() << "MucPlugin::join: " << name; |
| … |
… |
|
| 850 | 851 | |
| 851 | 852 | confInProgress.append(confName); |
| | 853 | if (!joinerBareJid.isEmpty()) |
| | 854 | { |
| | 855 | |
| | 856 | } |
| 852 | 857 | |
| 853 | 858 | // Don't create "Conference" object, because it's possible that we can't join it |
| … |
… |
|
| 886 | 891 | Conference*conf=conferences.byName(cname); |
| 887 | 892 | if (conf) |
| | 893 | { |
| 888 | 894 | conf->setAutoJoin(FALSE); |
| | 895 | conf->markOffline(); |
| | 896 | } |
| | 897 | |
| 889 | 898 | |
| 890 | 899 | /* Conference *conf=new Conference(cname,cnick); |
-
|
r284
|
r285
|
|
| 41 | 41 | QStringList confInProgress; |
| 42 | 42 | QString getItem(gloox::Stanza*, const QString& name); |
| 43 | | void join(const QString& name); |
| | 43 | void join(const QString& name, const QString& joinerBareJid=QString::null); |
| 44 | 44 | void leave(const QString& name); |
| 45 | 45 | Conference* getConf(gloox::Stanza* s); |