aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-05 17:32:33 -0700
committerfriendica <info@friendica.com>2013-08-05 17:32:33 -0700
commitc965ed2bb620d12873fdf13aea13d18f12dba063 (patch)
tree034e31f0733e89dd58eb1d5161218db7be58a4b4 /include
parentc86dfd2e0c1626003711194cdd4871790f1d6879 (diff)
downloadvolse-hubzilla-c965ed2bb620d12873fdf13aea13d18f12dba063.tar.gz
volse-hubzilla-c965ed2bb620d12873fdf13aea13d18f12dba063.tar.bz2
volse-hubzilla-c965ed2bb620d12873fdf13aea13d18f12dba063.zip
enotify: localize things we know how to translate
Diffstat (limited to 'include')
-rw-r--r--include/Contact.php2
-rw-r--r--include/conversation.php4
-rw-r--r--include/enotify.php16
3 files changed, 14 insertions, 8 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 7e6c65ac1..b9ad1e4cb 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -317,7 +317,7 @@ function contact_remove($channel_id, $abook_id) {
intval($channel_id)
);
- $r = q("delete from mail where ( from_xchan = '%s' or to_xchan = '%s' ) and uid = %d ",
+ $r = q("delete from mail where ( from_xchan = '%s' or to_xchan = '%s' ) and channel_id = %d ",
dbesc($abook['abook_xchan']),
dbesc($abook['abook_xchan']),
intval($channel_id)
diff --git a/include/conversation.php b/include/conversation.php
index 61b563a5d..fab8da9f9 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -91,10 +91,6 @@ function item_redir_and_replace_images($body, $images, $cid) {
function localize_item(&$item){
- $extracted = item_extract_images($item['body']);
- if($extracted['images'])
- $item['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $item['contact-id']);
-
if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){
$obj= json_decode($item['object'],true);
diff --git a/include/enotify.php b/include/enotify.php
index fc8eb6439..440156bb9 100644
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -50,11 +50,21 @@ function notification($params) {
$additional_mail_header = "";
- // We really should pass this through localize_item - but only if we have a complete item. We may only have a couple of elements.
if(array_key_exists('item',$params)) {
- $title = $params['item']['title'];
- $body = $params['item']['body'];
+ // if it's a normal item...
+ if(array_key_exists('verb',$params['item'])) {
+ require_once('include/conversation.php');
+ // localize_item() alters the original item so make a copy first
+ $i = $params['item'];
+ localize_item($i);
+ $title = $i['title'];
+ $body = $i['body'];
+ }
+ else {
+ $title = $params['item']['title'];
+ $body = $params['item']['body'];
+ }
}
else {
$title = $body = '';