Changeset 380:e9921b6fc914
- Timestamp:
- 05/18/2009 11:36:45 PM (3 years ago)
- Branch:
- default
- Files:
-
- 6 modified
- 1 moved
-
sql/pgsql.sql (modified) (2 diffs)
-
sql/update/dbupdate.sh (modified) (1 diff)
-
sql/update/pgsql/00380.sql (moved) (moved from sql/update/pgsql/00374.sql) (2 diffs)
-
src/base/dbversion.h (modified) (1 diff)
-
src/plugins/muc/jidstat.cpp (modified) (2 diffs)
-
src/plugins/muc/jidstat.h (modified) (1 diff)
-
src/plugins/muc/mucplugin.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sql/pgsql.sql
r371 r380 75 75 ); 76 76 77 DROP TABLE IF EXISTS conference_jidstat CASCADE; 78 CREATE TABLE conference_jidstat ( 79 id SERIAL, 80 jid_id int NOT NULL, 81 82 time_online int NOT NULL default 0, 83 84 lastaction int NOT NULL default '0', 85 lastreason varchar(200) NULL, 86 87 msg_count int NOT NULL default 0, 88 msg_chars int NOT NULL default 0, 89 msg_words int NOT NULL default 0, 90 msg_sentences int NOT NULL default 0, 91 msg_me int NOT NULL default 0, 92 msg_reply int NOT NULL default 0, 93 msg_subject int NOT NULL default 0, 94 95 cnt_join int NOT NULL default 0, 96 cnt_leave int NOT NULL default 0, 97 cnt_presence int NOT NULL default 0, 98 cnt_nickchange int NOT NULL default 0, 99 cnt_visitor int NOT NULL default 0, 100 cnt_participant int NOT NULL default 0, 101 cnt_moderator int NOT NULL default 0, 102 cnt_noaffiliation int NOT NULL default 0, 103 cnt_member int NOT NULL default 0, 104 cnt_administrator int NOT NULL default 0, 105 cnt_owner int NOT NULL default 0, 106 cnt_kick int NOT NULL default 0, 107 cnt_ban int NOT NULL default 0, 108 109 ver_name varchar(50) NULL, 110 ver_version varchar(50) NULL, 111 ver_os varchar(200) NULL, 112 113 PRIMARY KEY(id), 114 FOREIGN KEY(jid_id) REFERENCES conference_jids(id) ON DELETE CASCADE, 115 UNIQUE(jid_id) 116 ); 117 77 118 DROP TABLE IF EXISTS webstatus CASCADE; 78 119 CREATE TABLE webstatus ( … … 137 178 ); 138 179 139 INSERT INTO version (name, value) VALUES ('dbversion', 3 52);180 INSERT INTO version (name, value) VALUES ('dbversion', 380); -
sql/update/dbupdate.sh
r352 r380 8 8 QUERYCMD="" 9 9 INLINE_SUFFIX="" 10 11 if [ "$DBTYPE" = "mysql" ]; then 12 echo "MySQL support is currently out of date" 13 exit 1 14 fi 10 15 11 16 if [ -f "dbupdate.cfg" ]; then -
sql/update/pgsql/00380.sql
r379 r380 15 15 msg_me int NOT NULL default 0, 16 16 msg_reply int NOT NULL default 0, 17 msg_subject int NOT NULL default 0, 17 18 18 19 cnt_join int NOT NULL default 0, … … 30 31 cnt_ban int NOT NULL default 0, 31 32 32 version varchar(200) NULL, 33 ver_name varchar(50) NULL, 34 ver_version varchar(50) NULL, 35 ver_os varchar(200) NULL, 33 36 34 37 PRIMARY KEY(id), -
src/base/dbversion.h
r353 r380 21 21 #define DBVERSION_H 22 22 23 #define GLUXI_DB_VERSION 3 5223 #define GLUXI_DB_VERSION 380 24 24 25 25 #endif -
src/plugins/muc/jidstat.cpp
r379 r380 161 161 } 162 162 163 void JidStat::setVersion(const QString& v) 164 { 165 if (id_ <= 0) 166 return; 167 168 QSqlQuery q = DataStorage::instance()->prepareQuery( 169 "UPDATE conference_jidstat SET version=? WHERE id=?" 170 ); 171 q.addBindValue(v); 163 void JidStat::setVersion(const QString& name, const QString& version, const QString& os) 164 { 165 if (id_ <= 0) 166 return; 167 168 QSqlQuery q = DataStorage::instance()->prepareQuery( 169 "UPDATE conference_jidstat SET ver_name=?, ver_version=?,ver_os=? WHERE id=?" 170 ); 171 q.addBindValue(name); 172 q.addBindValue(version); 173 q.addBindValue(os); 172 174 q.addBindValue(id_); 173 175 if (!q.exec()) … … 268 270 } 269 271 272 void JidStat::statSubject(const QString& subject) 273 { 274 Q_UNUSED(subject); 275 if (id_ <= 0) 276 return; 277 278 QSqlQuery q = DataStorage::instance()->prepareQuery( 279 "UPDATE conference_jidstat SET msg_subject = msg_subject + 1 WHERE id=?"); 280 q.addBindValue(id_); 281 if (!q.exec()) 282 { 283 qDebug() << "ERROR: Unable to stat subject: " << q.lastError().text(); 284 } 285 } -
src/plugins/muc/jidstat.h
r379 r380 53 53 void commit(); 54 54 void setLastAction(ActionType type, const QString& reason); 55 void setVersion(const QString& version);55 void setVersion(const QString& name, const QString& version, const QString& os); 56 56 void updateOnlineTime(); 57 57 void statMessage(const QString& msg); 58 58 void statReply(); 59 void statSubject(const QString& subject); 59 60 private: 60 61 int id_; -
src/plugins/muc/mucplugin.cpp
r379 r380 536 536 JidStat *stat = nick->jidStat(); 537 537 if (stat) 538 stat->statMessage(msgBody); 538 { 539 if (!msgBody.isEmpty()) 540 stat->statMessage(msgBody); 541 QString subject = QString::fromStdString(s->subject()); 542 if (!subject.isEmpty()) 543 stat->statSubject(subject); 544 } 539 545 540 546 if (msgBody.contains(':')) … … 1237 1243 if (stat) 1238 1244 { 1239 stat->setVersion( QString("%1 %2 // %3").arg(nick->versionName(),1240 nick->version Client(), nick->versionOs()));1245 stat->setVersion(nick->versionName(), nick->versionClient(), 1246 nick->versionOs()); 1241 1247 } 1242 1248
