summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r--src/leap/bitmask/core/mail_services.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/leap/bitmask/core/mail_services.py b/src/leap/bitmask/core/mail_services.py
index 92712019..7d5d9533 100644
--- a/src/leap/bitmask/core/mail_services.py
+++ b/src/leap/bitmask/core/mail_services.py
@@ -34,6 +34,7 @@ from twisted.internet import task
from twisted.logger import Logger
from leap.common.files import check_and_fix_urw_only
+from leap.bitmask import pix
from leap.bitmask.hooks import HookableService
from leap.bitmask.bonafide import config
from leap.bitmask.keymanager import KeyManager
@@ -499,6 +500,7 @@ class StandardMailService(service.MultiService, HookableService):
d = soledad.get_or_create_service_token('mail_auth')
d.addCallback(registerToken)
d.addCallback(self._write_tokens_file, userid)
+ d.addCallback(self._maybe_start_pixelated, userid, soledad, keymanager)
return d
# hooks
@@ -621,6 +623,8 @@ class StandardMailService(service.MultiService, HookableService):
def get_keymanager_session(self, userid):
return self._keymanager_sessions.get(userid)
+ # other helpers
+
def _write_tokens_file(self, token, userid):
tokens_folder = os.path.join(tempfile.gettempdir(), "bitmask_tokens")
if os.path.exists(tokens_folder):
@@ -638,6 +642,13 @@ class StandardMailService(service.MultiService, HookableService):
with open(tokens_path, 'w') as ftokens:
json.dump(token_dict, ftokens)
+ def _maybe_start_pixelated(self, passthrough, userid, soledad, keymanager):
+ if pix.HAS_PIXELATED:
+ reactor.callFromThread(
+ pix.start_pixelated_user_agent,
+ userid, soledad, keymanager)
+ return passthrough
+
class IMAPService(service.Service):