Changeset 376:b1de526e34c8
- Timestamp:
- 05/18/2009 10:08:39 PM (3 years ago)
- Author:
- Dmitry Nezhevenko <dion@…>
- Branch:
- default
- Message:
-
Count status ActionType? changes
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r375
|
r376
|
|
| 5 | 5 | lastaction int NOT NULL default '0', |
| 6 | 6 | lastreason varchar(200) NULL, |
| 7 | | /* |
| 8 | | cnt_ban int NOT NULL default 0, |
| | 7 | |
| | 8 | cnt_join int NOT NULL default 0, |
| | 9 | cnt_leave int NOT NULL default 0, |
| | 10 | cnt_presence int NOT NULL default 0, |
| | 11 | cnt_nickchange int NOT NULL default 0, |
| 9 | 12 | cnt_visitor int NOT NULL default 0, |
| 10 | 13 | cnt_participant int NOT NULL default 0, |
| | 14 | cnt_moderator int NOT NULL default 0, |
| | 15 | cnt_noaffiliation int NOT NULL default 0, |
| 11 | 16 | cnt_member int NOT NULL default 0, |
| 12 | | cnt_moderator int NOT NULL default 0, |
| | 17 | cnt_administrator int NOT NULL default 0, |
| 13 | 18 | cnt_owner int NOT NULL default 0, |
| 14 | | cnt_statuschange int NOT NULL default 0, |
| 15 | | cnt_sentence int NOT NULL default 0, |
| 16 | | cnt_word int NOT NULL default 0, |
| 17 | | */ |
| | 19 | cnt_kick int NOT NULL default 0, |
| | 20 | cnt_ban int NOT NULL default 0, |
| 18 | 21 | PRIMARY KEY(id), |
| 19 | 22 | FOREIGN KEY(jid_id) REFERENCES conference_jids(id) ON DELETE CASCADE, |
-
|
r375
|
r376
|
|
| 102 | 102 | qDebug() << "ERROR: Unable to update Last action: " << q.lastError().text(); |
| 103 | 103 | } |
| | 104 | |
| | 105 | QString cntName; |
| | 106 | switch (type) |
| | 107 | { |
| | 108 | case ActionJoin: |
| | 109 | cntName = "cnt_join"; |
| | 110 | break; |
| | 111 | case ActionLeave: |
| | 112 | cntName = "cnt_leave"; |
| | 113 | break; |
| | 114 | case ActionPresence: |
| | 115 | cntName = "cnt_presence"; |
| | 116 | break; |
| | 117 | case ActionNickChange: |
| | 118 | cntName = "cnt_nickchange"; |
| | 119 | break; |
| | 120 | case ActionVisitor: |
| | 121 | cntName = "cnt_visitor"; |
| | 122 | break; |
| | 123 | case ActionParticipant: |
| | 124 | cntName = "cnt_participant"; |
| | 125 | break; |
| | 126 | case ActionModerator: |
| | 127 | cntName = "cnt_moderator"; |
| | 128 | break; |
| | 129 | case ActionNoAffiliation: |
| | 130 | cntName = "cnt_noaffiliation"; |
| | 131 | break; |
| | 132 | case ActionMember: |
| | 133 | cntName = "cnt_member"; |
| | 134 | break; |
| | 135 | case ActionAdministrator: |
| | 136 | cntName = "cnt_administrator"; |
| | 137 | break; |
| | 138 | case ActionOwner: |
| | 139 | cntName = "cnt_owner"; |
| | 140 | break; |
| | 141 | case ActionBan: |
| | 142 | cntName = "cnt_ban"; |
| | 143 | break; |
| | 144 | case ActionKick: |
| | 145 | cntName = "cnt_kick"; |
| | 146 | break; |
| | 147 | } |
| | 148 | |
| | 149 | if (!cntName.isEmpty()) |
| | 150 | { |
| | 151 | q.prepare(QString("UPDATE conference_jidstat set %1 = %1 + 1 WHERE id=?").arg(cntName, cntName)); |
| | 152 | q.addBindValue(id_); |
| | 153 | if (!q.exec()) |
| | 154 | { |
| | 155 | qDebug() << "ERROR: Unable to update jidstat for field: " << cntName; |
| | 156 | } |
| | 157 | } |
| 104 | 158 | } |
-
|
r375
|
r376
|
|
| 32 | 32 | ActionLeave = 2, |
| 33 | 33 | ActionPresence = 3, |
| 34 | | ActionChangeNick = 4, |
| | 34 | ActionNickChange = 4, |
| 35 | 35 | |
| 36 | 36 | ActionVisitor = 5, |
| … |
… |
|
| 41 | 41 | ActionMember = 9, |
| 42 | 42 | ActionAdministrator = 10, |
| | 43 | ActionOwner = 11, |
| 43 | 44 | |
| 44 | | ActionOwner = 11, |
| 45 | 45 | ActionBan = 12, |
| 46 | 46 | ActionKick = 13, |