Index: trunk/extensions/WikiLove/WikiLove.api.php |
— | — | @@ -56,15 +56,26 @@ |
57 | 57 | private function saveInDb( $talk, $subject, $message, $type, $email ) { |
58 | 58 | global $wgUser; |
59 | 59 | $dbw = wfGetDB( DB_MASTER ); |
| 60 | + $receiver = User::newFromName( $talk->getSubjectPage()->getBaseText() ); |
| 61 | + if ( $receiver->isAnon() ) { |
| 62 | + $this->setWarning( 'Not logging anonymous recipients' ); |
| 63 | + return; |
| 64 | + } |
| 65 | + |
60 | 66 | $values = array( |
61 | 67 | 'wll_timestamp' => $dbw->timestamp(), |
62 | 68 | 'wll_sender' => $wgUser->getId(), |
63 | | - 'wll_receiver' => User::newFromName( $talk->getSubjectPage()->getBaseText() )->getId(), |
| 69 | + 'wll_sender_editcount' => $wgUser->getEditCount(), |
| 70 | + 'wll_sender_registration' => $wgUser->getRegistration(), |
| 71 | + 'wll_receiver' => $receiver->getId(), |
| 72 | + 'wll_receiver_editcount' => $receiver->getEditCount(), |
| 73 | + 'wll_receiver_registration' => $receiver->getRegistration(), |
64 | 74 | 'wll_type' => $type, |
65 | 75 | 'wll_subject' => $subject, |
66 | 76 | 'wll_message' => $message, |
67 | 77 | 'wll_email' => $email, |
68 | 78 | ); |
| 79 | + |
69 | 80 | try{ |
70 | 81 | $dbw->insert( 'wikilove_log', $values, __METHOD__ ); |
71 | 82 | } catch( DBQueryError $dbqe ) { |
Index: trunk/extensions/WikiLove/patches/WikiLoveLog.sql |
— | — | @@ -8,13 +8,11 @@ |
9 | 9 | wll_id int NOT NULL PRIMARY KEY auto_increment, -- unique id |
10 | 10 | wll_timestamp binary(14) NOT NULL, -- timestamp |
11 | 11 | wll_sender int(11) NOT NULL, -- user id of the sender |
12 | | - wll_sender_registration varchar(16) default NULL, -- registration date of the sender |
13 | | - wll_sender_totaledits mediumint(8) default NULL, -- total number of edits for the sender |
14 | | - wll_sender_recentedits smallint(6) default NULL, -- number of recent edits for the sender |
| 12 | + wll_sender_registration binary(14) default NULL, -- registration date of the sender |
| 13 | + wll_sender_editcount int(11) default NULL, -- total number of edits for the sender |
15 | 14 | wll_receiver int(11) NOT NULL, -- user id of the receiver |
16 | | - wll_receiver_registration varchar(16) default NULL, -- registration date of the receiver |
17 | | - wll_receiver_totaledits mediumint(8) default NULL, -- total number of edits for the receiver |
18 | | - wll_receiver_recentedits smallint(6) default NULL, -- number of recent edits for the receiver |
| 15 | + wll_receiver_registration binary(14) default NULL, -- registration date of the receiver |
| 16 | + wll_receiver_editcount int(11) default NULL, -- total number of edits for the receiver |
19 | 17 | wll_type varchar(64) NOT NULL, -- type (and subtype) of message |
20 | 18 | wll_subject varchar(255) NOT NULL, -- subject line |
21 | 19 | wll_message blob NOT NULL, -- actual message |