enotify: localize things we know how to translate
This commit is contained in:
parent
c86dfd2e0c
commit
c965ed2bb6
@ -317,7 +317,7 @@ function contact_remove($channel_id, $abook_id) {
|
|||||||
intval($channel_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']),
|
||||||
dbesc($abook['abook_xchan']),
|
dbesc($abook['abook_xchan']),
|
||||||
intval($channel_id)
|
intval($channel_id)
|
||||||
|
@ -91,10 +91,6 @@ function item_redir_and_replace_images($body, $images, $cid) {
|
|||||||
|
|
||||||
function localize_item(&$item){
|
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)){
|
if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){
|
||||||
|
|
||||||
$obj= json_decode($item['object'],true);
|
$obj= json_decode($item['object'],true);
|
||||||
|
@ -50,12 +50,22 @@ function notification($params) {
|
|||||||
|
|
||||||
$additional_mail_header = "";
|
$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)) {
|
if(array_key_exists('item',$params)) {
|
||||||
|
// 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'];
|
$title = $params['item']['title'];
|
||||||
$body = $params['item']['body'];
|
$body = $params['item']['body'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$title = $body = '';
|
$title = $body = '';
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
2013-08-04.395
|
2013-08-05.396
|
||||||
|
Reference in New Issue
Block a user