issue #65
This commit is contained in:
parent
822a4a0287
commit
b86253c655
@ -850,7 +850,6 @@ function smilies($s, $sample = false) {
|
|||||||
':like',
|
':like',
|
||||||
':dislike',
|
':dislike',
|
||||||
'red#',
|
'red#',
|
||||||
'~friendika',
|
|
||||||
'~friendica'
|
'~friendica'
|
||||||
|
|
||||||
);
|
);
|
||||||
@ -889,7 +888,6 @@ function smilies($s, $sample = false) {
|
|||||||
'<img class="smiley" src="' . $a->get_baseurl() . '/images/like.gif" alt=":like" />',
|
'<img class="smiley" src="' . $a->get_baseurl() . '/images/like.gif" alt=":like" />',
|
||||||
'<img class="smiley" src="' . $a->get_baseurl() . '/images/dislike.gif" alt=":dislike" />',
|
'<img class="smiley" src="' . $a->get_baseurl() . '/images/dislike.gif" alt=":dislike" />',
|
||||||
'<img class="smiley" src="' . $a->get_baseurl() . '/images/rhash-16.png" alt="red#" /></a>',
|
'<img class="smiley" src="' . $a->get_baseurl() . '/images/rhash-16.png" alt="red#" /></a>',
|
||||||
'<a href="http://project.friendika.com">~friendika <img class="smiley" src="' . $a->get_baseurl() . '/images/friendika-16.png" alt="~friendika" /></a>',
|
|
||||||
'<a href="http://friendica.com">~friendica <img class="smiley" src="' . $a->get_baseurl() . '/images/friendica-16.png" alt="~friendica" /></a>'
|
'<a href="http://friendica.com">~friendica <img class="smiley" src="' . $a->get_baseurl() . '/images/friendica-16.png" alt="~friendica" /></a>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1036,6 +1036,10 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($arr['item_restrict'] & ITEM_DELETED) {
|
if($arr['item_restrict'] & ITEM_DELETED) {
|
||||||
|
|
||||||
|
// remove_community_tag is a no-op if this isn't a community tag activity
|
||||||
|
remove_community_tag($sender,$arr,$channel['channel_id']);
|
||||||
|
|
||||||
$item_id = delete_imported_item($sender,$arr,$channel['channel_id']);
|
$item_id = delete_imported_item($sender,$arr,$channel['channel_id']);
|
||||||
$result[] = array($d['hash'],'deleted');
|
$result[] = array($d['hash'],'deleted');
|
||||||
|
|
||||||
@ -1116,6 +1120,68 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function remove_community_tag($sender,$arr,$uid) {
|
||||||
|
|
||||||
|
if(! (activity_match($arr['verb'],ACTIVITY_TAG) && ($arr['obj_type'] == ACTIVITY_OBJ_TAGTERM)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
logger('remove_community_tag: invoked');
|
||||||
|
|
||||||
|
|
||||||
|
if(! get_pconfig($uid,'system','blocktags')) {
|
||||||
|
logger('remove_community tag: permission denied.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$r = q("select * from item where mid = '%s' and uid = %d limit 1",
|
||||||
|
dbesc($arr['mid']),
|
||||||
|
intval($uid)
|
||||||
|
);
|
||||||
|
if(! $r) {
|
||||||
|
logger('remove_community_tag: no item');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(($sender['hash'] != $r[0]['owner_xchan']) && ($sender['hash'] != $r[0]['author_xchan'])) {
|
||||||
|
logger('remove_community_tag: sender not authorised.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = $r[0];
|
||||||
|
|
||||||
|
if($i['target'])
|
||||||
|
$i['target'] = json_decode($i['target'],true);
|
||||||
|
if($i['object'])
|
||||||
|
$i['object'] = json_decode($i['object'],true);
|
||||||
|
|
||||||
|
if(! ($i['target'] && $i['object'])) {
|
||||||
|
logger('remove_community_tag: no target/object');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$message_id = $i['target']['id'];
|
||||||
|
|
||||||
|
$r = q("select id from item where mid = '%s' and uid = %d limit 1",
|
||||||
|
dbesc($message_id),
|
||||||
|
intval($uid)
|
||||||
|
);
|
||||||
|
if(! $r) {
|
||||||
|
logger('remove_community_tag: no parent message');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$x = q("delete from term where uid = %d and oid = %d and otype = %d and type = %d and term = '%s' and url = '%s' limit 1",
|
||||||
|
intval($uid),
|
||||||
|
intval($r[0]['id']),
|
||||||
|
intval(TERM_OBJ_POST),
|
||||||
|
intval(TERM_HASHTAG),
|
||||||
|
dbesc($i['object']['title']),
|
||||||
|
dbesc(get_rel_link($i['object']['link'],'alternate'))
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function update_imported_item($sender,$item,$uid) {
|
function update_imported_item($sender,$item,$uid) {
|
||||||
|
|
||||||
item_store_update($item);
|
item_store_update($item);
|
||||||
|
16
js/main.js
16
js/main.js
@ -343,6 +343,8 @@
|
|||||||
|
|
||||||
function updateConvItems(mode,data) {
|
function updateConvItems(mode,data) {
|
||||||
|
|
||||||
|
var expanded_comments = false;
|
||||||
|
|
||||||
if(mode === 'update') {
|
if(mode === 'update') {
|
||||||
prev = 'threads-begin';
|
prev = 'threads-begin';
|
||||||
|
|
||||||
@ -353,7 +355,14 @@ function updateConvItems(mode,data) {
|
|||||||
$('img',this).each(function() {
|
$('img',this).each(function() {
|
||||||
$(this).attr('src',$(this).attr('dst'));
|
$(this).attr('src',$(this).attr('dst'));
|
||||||
});
|
});
|
||||||
|
// expanded_comments = false;
|
||||||
|
// $('.collapsed-comments',this).each(function() {
|
||||||
|
// if($(this).is(':visible'))
|
||||||
|
// expanded_comments = this;
|
||||||
|
// });
|
||||||
$('#' + prev).after($(this));
|
$('#' + prev).after($(this));
|
||||||
|
// if(expanded_comments)
|
||||||
|
// $(expanded_comments).show();
|
||||||
$(".autotime").timeago();
|
$(".autotime").timeago();
|
||||||
// divgrow doesn't prevent itself from attaching a second (or 500th)
|
// divgrow doesn't prevent itself from attaching a second (or 500th)
|
||||||
// "show more" div to a content region - it also has a few other
|
// "show more" div to a content region - it also has a few other
|
||||||
@ -365,7 +374,14 @@ function updateConvItems(mode,data) {
|
|||||||
$('img',this).each(function() {
|
$('img',this).each(function() {
|
||||||
$(this).attr('src',$(this).attr('dst'));
|
$(this).attr('src',$(this).attr('dst'));
|
||||||
});
|
});
|
||||||
|
// expanded_comments = false;
|
||||||
|
// $('.collapsed-comments',this).each(function() {
|
||||||
|
// if($(this).is(':visible'))
|
||||||
|
// expanded_comments = this;
|
||||||
|
// });
|
||||||
$('#' + ident).replaceWith($(this));
|
$('#' + ident).replaceWith($(this));
|
||||||
|
// if(expanded_comments)
|
||||||
|
// $(expanded_comments).show();
|
||||||
$(".autotime").timeago();
|
$(".autotime").timeago();
|
||||||
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
2013-06-30.360
|
2013-07-01.361
|
||||||
|
Reference in New Issue
Block a user