Index: trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php |
— | — | @@ -82,6 +82,10 @@ |
83 | 83 | $filters['undeleted'] = -1; |
84 | 84 | } |
85 | 85 | |
| 86 | + // TODO: This is data for the "hidden by, oversighted by" red line |
| 87 | + $results['oversight_user'] = $wgUser->getId(); |
| 88 | + $results['oversight_timestamp'] = $timestamp; |
| 89 | + |
86 | 90 | // autohide if not hidden |
87 | 91 | if (false == $record->af_is_hidden ) { |
88 | 92 | $update['af_is_hidden'] = true; |
— | — | @@ -91,6 +95,11 @@ |
92 | 96 | $update['af_hide_user_id'] = 0; |
93 | 97 | $update['af_hide_timestamp'] = $timestamp; |
94 | 98 | $implicit_hide = true; // for logging |
| 99 | + // tell front-end autohiding was done |
| 100 | + $results['autohidden'] = 1; |
| 101 | + // TODO: This is data for the "hidden by, oversighted by" red line |
| 102 | + $results['hide_user'] = 0; |
| 103 | + $results['hide_timestamp'] = $timestamp; |
95 | 104 | } |
96 | 105 | |
97 | 106 | } else { |
— | — | @@ -120,6 +129,10 @@ |
121 | 130 | $update['af_hide_timestamp'] = $timestamp; |
122 | 131 | $filters = $this->changeFilterCounts( $record, $filters, 'hide' ); |
123 | 132 | |
| 133 | + // TODO: This is data for the "hidden by, oversighted by" red line |
| 134 | + $results['hide_user'] = $wgUser->getId(); |
| 135 | + $results['hide_timestamp'] = $timestamp; |
| 136 | + |
124 | 137 | } else { |
125 | 138 | // decrease means "unhide this" |
126 | 139 | $activity = 'unhidden'; |
— | — | @@ -185,6 +198,12 @@ |
186 | 199 | $filters = $this->changeFilterCounts( $record, $filters, 'hide' ); |
187 | 200 | $results['abuse-hidden'] = 1; |
188 | 201 | $implicit_hide = true; |
| 202 | + |
| 203 | + // tell front-end autohiding was done |
| 204 | + $results['autohidden'] = 1; |
| 205 | + // TODO: This is data for the "hidden by, oversighted by" red line |
| 206 | + $results['hide_user'] = 0; |
| 207 | + $results['hide_timestamp'] = $timestamp; |
189 | 208 | } |
190 | 209 | } |
191 | 210 | |
— | — | @@ -224,24 +243,21 @@ |
225 | 244 | $update['af_is_unhidden'] = false; |
226 | 245 | // 0 is used for "autohidden" purposes, we'll explicitly set it to overwrite last hider |
227 | 246 | $update['af_hide_user_id'] = 0; |
| 247 | + $update['af_hide_timestamp'] = $timestamp; |
| 248 | + |
228 | 249 | $filters = $this->changeFilterCounts( $record, $filters, 'hide' ); |
229 | 250 | $implicit_hide = true; // for logging |
| 251 | + // tell front-end autohiding was done |
| 252 | + $results['autohidden'] = 1; |
| 253 | + // TODO: This is data for the "hidden by, oversighted by" red line |
| 254 | + $results['hide_user'] = 0; |
| 255 | + $results['hide_timestamp'] = $timestamp; |
230 | 256 | } |
231 | 257 | } elseif($direction == 'decrease') { |
232 | 258 | $activity = 'unrequest'; |
233 | 259 | $filters['needsoversight'] = -1; |
234 | 260 | // NOTE: we are bypassing traditional sql escaping here |
235 | 261 | $update[] = "af_oversight_count = GREATEST(CONVERT(af_oversight_count, SIGNED) - 1, 0)"; |
236 | | - |
237 | | - // Un-hide if we don't have oversight flags anymore |
238 | | - if( $record->af_oversight_count == 1 && true == $record->af_is_hidden ) { |
239 | | - $update['af_is_hidden'] = false; |
240 | | - $update['af_is_unhidden'] = true; |
241 | | - |
242 | | - $filters = $this->changeFilterCounts( $record, $filters, 'show' ); |
243 | | - |
244 | | - $implicit_unhide = true; |
245 | | - } |
246 | 262 | } else { |
247 | 263 | // TODO: real error here? |
248 | 264 | $error = 'articlefeedbackv5-invalid-feedback-flag'; |
— | — | @@ -356,12 +372,8 @@ |
357 | 373 | } |
358 | 374 | |
359 | 375 | // handle implicit hide/show logging |
360 | | - if ( isset( $implicit_hide ) || isset ( $implicit_unhide )) { |
361 | | - if ( $implicit_hide ) { |
362 | | - $activity = 'hidden'; |
363 | | - } else { |
364 | | - $activity = 'show'; |
365 | | - } |
| 376 | + if ( isset( $implicit_hide )) { |
| 377 | + $activity = 'hidden'; |
366 | 378 | ApiArticleFeedbackv5Utils::logActivity( $activity , $pageId, $feedbackId, '', true); |
367 | 379 | } |
368 | 380 | |