diff --git a/backend/app/api/office.py b/backend/app/api/office.py index fc7a9de..656f9f0 100644 --- a/backend/app/api/office.py +++ b/backend/app/api/office.py @@ -8,9 +8,10 @@ from flask import request, jsonify, current_app, send_file from app.api import api_bp from app.api.auth import token_required -from app.api.files import _get_file_or_403 +from app.api.files import _get_file_or_403, _share_recipients from app.extensions import db from app.models.settings import AppSettings +from app.services.events import notify_file_change @api_bp.route('/files//preview', methods=['GET']) @@ -219,6 +220,8 @@ def save_file(file_id): f.updated_at = datetime.now(timezone.utc) db.session.commit() + notify_file_change(f.owner_id, f.id, 'updated', + shared_with=_share_recipients(f)) return jsonify({'message': 'Gespeichert', 'size': f.size}), 200 except Exception as e: return jsonify({'error': f'Speichern fehlgeschlagen: {str(e)}'}), 500 @@ -482,6 +485,8 @@ def onlyoffice_callback(): f.checksum = h.hexdigest() f.updated_at = datetime.now(timezone.utc) db.session.commit() + notify_file_change(f.owner_id, f.id, 'updated', + shared_with=_share_recipients(f)) print(f'[OnlyOffice Callback] File saved: {f.name} ({f.size} bytes)') # Status 2, 4, 6: cleanup