summaryrefslogtreecommitdiff
path: root/poezio/core/handlers.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-04 12:33:23 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-04 12:33:38 +0200
commit84107bdd772255e735584b330d8521f52513ac28 (patch)
tree96613da4455fb391111ddab5899e0614b18fa7df /poezio/core/handlers.py
parent60ba8308faed5afea9996c4c70d86b6499ed18ef (diff)
downloadpoezio-84107bdd772255e735584b330d8521f52513ac28.tar.gz
poezio-84107bdd772255e735584b330d8521f52513ac28.tar.bz2
poezio-84107bdd772255e735584b330d8521f52513ac28.tar.xz
poezio-84107bdd772255e735584b330d8521f52513ac28.zip
Factorise retrieving tmp_image_dir.
Diffstat (limited to 'poezio/core/handlers.py')
-rw-r--r--poezio/core/handlers.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py
index 380715fc..25cb15b3 100644
--- a/poezio/core/handlers.py
+++ b/poezio/core/handlers.py
@@ -30,7 +30,7 @@ from poezio import tabs
from poezio import xhtml
from poezio import multiuserchat as muc
from poezio.common import safeJID
-from poezio.config import config, CACHE_DIR
+from poezio.config import config
from poezio.core.structs import Status
from poezio.contact import Resource
from poezio.logger import logger
@@ -274,9 +274,7 @@ class HandlerCore:
use_xhtml = config.get_by_tabname('enable_xhtml_im',
message['from'].bare)
- tmp_dir = None
- if config.get('extract_inline_images'):
- tmp_dir = config.get('tmp_image_dir') or path.join(CACHE_DIR, 'images')
+ tmp_dir = config.get_image_cache()
body = xhtml.get_body_from_message_stanza(
message,
use_xhtml=use_xhtml,
@@ -668,9 +666,7 @@ class HandlerCore:
self.core.events.trigger('muc_msg', message, tab)
use_xhtml = config.get_by_tabname('enable_xhtml_im', room_from)
- tmp_dir = None
- if config.get('extract_inline_images'):
- tmp_dir = config.get('tmp_image_dir') or path.join(CACHE_DIR, 'images')
+ tmp_dir = config.get_image_cache()
body = xhtml.get_body_from_message_stanza(
message,
use_xhtml=use_xhtml,
@@ -746,9 +742,7 @@ class HandlerCore:
room_from = jid.bare
use_xhtml = config.get_by_tabname('enable_xhtml_im', jid.bare)
- tmp_dir = None
- if config.get('extract_inline_images'):
- tmp_dir = config.get('tmp_image_dir') or path.join(CACHE_DIR, 'images')
+ tmp_dir = config.get_image_cache()
body = xhtml.get_body_from_message_stanza(
message,
use_xhtml=use_xhtml,