Do not expose activity on every autosave
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -29,9 +29,11 @@ class Card extends RelationalEntity {
|
||||
|
||||
protected $title;
|
||||
protected $description;
|
||||
protected $descriptionPrev;
|
||||
protected $stackId;
|
||||
protected $type;
|
||||
protected $lastModified;
|
||||
protected $lastEditor;
|
||||
protected $createdAt;
|
||||
protected $labels;
|
||||
protected $assignedUsers;
|
||||
@@ -113,6 +115,7 @@ class Card extends RelationalEntity {
|
||||
}
|
||||
$json['duedate'] = $this->getDuedate(true);
|
||||
unset($json['notified']);
|
||||
unset($json['descriptionPrev']);
|
||||
return $json;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,6 +147,11 @@ class CardMapper extends DeckMapper implements IPermissionMapper {
|
||||
return $this->findEntities($sql);
|
||||
}
|
||||
|
||||
public function findUnexposedDescriptionChances() {
|
||||
$sql = 'SELECT id,title,duedate,notified,description_prev,last_editor,description from `*PREFIX*deck_cards` WHERE last_editor IS NOT NULL AND description_prev IS NOT NULL';
|
||||
return $this->findEntities($sql);
|
||||
}
|
||||
|
||||
public function delete(Entity $entity) {
|
||||
// delete assigned labels
|
||||
$this->labelMapper->deleteLabelAssignmentsForCard($entity->getId());
|
||||
|
||||
@@ -41,11 +41,13 @@ class ChangeHelper {
|
||||
public function __construct(
|
||||
IDBConnection $db,
|
||||
ICacheFactory $cacheFactory,
|
||||
IRequest $request
|
||||
IRequest $request,
|
||||
$userId
|
||||
) {
|
||||
$this->db = $db;
|
||||
$this->cache = $cacheFactory->createDistributed('deck_changes');
|
||||
$this->request = $request;
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
public function boardChanged($boardId) {
|
||||
@@ -61,8 +63,8 @@ class ChangeHelper {
|
||||
$etag = md5($time . microtime());
|
||||
$this->cache->set(self::TYPE_CARD . '-' .$cardId, $etag);
|
||||
if ($updateCard) {
|
||||
$sql = 'UPDATE `*PREFIX*deck_cards` SET `last_modified` = ? WHERE `id` = ?';
|
||||
$this->db->executeUpdate($sql, [time(), $cardId]);
|
||||
$sql = 'UPDATE `*PREFIX*deck_cards` SET `last_modified` = ?, `last_editor` = ? WHERE `id` = ?';
|
||||
$this->db->executeUpdate($sql, [time(), $this->userId, $cardId]);
|
||||
}
|
||||
|
||||
$sql = 'SELECT s.board_id as id, c.stack_id as stack_id FROM `*PREFIX*deck_stacks` as s inner join `*PREFIX*deck_cards` as c ON c.stack_id = s.id WHERE c.id = ?';
|
||||
|
||||
Reference in New Issue
Block a user