mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-12 10:32:13 -04:00
Add account data to export command (#14969)
* Add account data to to export command * newsfile * remove not needed function * update newsfile * adopt #14973
This commit is contained in:
parent
4f4f27e57f
commit
61bfcd669a
5 changed files with 79 additions and 16 deletions
|
@ -17,7 +17,7 @@ import logging
|
|||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
from typing import List, Optional
|
||||
from typing import List, Mapping, Optional
|
||||
|
||||
from twisted.internet import defer, task
|
||||
|
||||
|
@ -222,6 +222,19 @@ class FileExfiltrationWriter(ExfiltrationWriter):
|
|||
with open(connection_file, "a") as f:
|
||||
print(json.dumps(connection), file=f)
|
||||
|
||||
def write_account_data(
|
||||
self, file_name: str, account_data: Mapping[str, JsonDict]
|
||||
) -> None:
|
||||
account_data_directory = os.path.join(
|
||||
self.base_directory, "user_data", "account_data"
|
||||
)
|
||||
os.makedirs(account_data_directory, exist_ok=True)
|
||||
|
||||
account_data_file = os.path.join(account_data_directory, file_name)
|
||||
|
||||
with open(account_data_file, "a") as f:
|
||||
print(json.dumps(account_data), file=f)
|
||||
|
||||
def finished(self) -> str:
|
||||
return self.base_directory
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue