Changeset 376:b1de526e34c8

Show
Ignore:
Timestamp:
05/18/2009 10:08:39 PM (3 years ago)
Author:
Dmitry Nezhevenko <dion@…>
Branch:
default
Message:

Count status ActionType? changes

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • sql/update/pgsql/00374.sql

    r375 r376  
    55  lastaction int NOT NULL default '0', 
    66  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, 
    912  cnt_visitor int NOT NULL default 0, 
    1013  cnt_participant int NOT NULL default 0, 
     14  cnt_moderator int NOT NULL default 0, 
     15  cnt_noaffiliation int NOT NULL default 0, 
    1116  cnt_member int NOT NULL default 0, 
    12   cnt_moderator int NOT NULL default 0, 
     17  cnt_administrator int NOT NULL default 0, 
    1318  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, 
    1821  PRIMARY KEY(id), 
    1922  FOREIGN KEY(jid_id) REFERENCES conference_jids(id) ON DELETE CASCADE, 
  • src/plugins/muc/jidstat.cpp

    r375 r376  
    102102                qDebug() << "ERROR: Unable to update Last action: " << q.lastError().text(); 
    103103        } 
     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        } 
    104158} 
  • src/plugins/muc/jidstat.h

    r375 r376  
    3232                ActionLeave = 2, 
    3333                ActionPresence = 3, 
    34                 ActionChangeNick = 4, 
     34                ActionNickChange = 4, 
    3535 
    3636                ActionVisitor = 5, 
     
    4141                ActionMember = 9, 
    4242                ActionAdministrator = 10, 
     43                ActionOwner = 11, 
    4344 
    44                 ActionOwner = 11, 
    4545                ActionBan = 12, 
    4646                ActionKick = 13,