diff options
author | Mario <mario@mariovavti.com> | 2022-09-27 08:59:44 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-09-27 08:59:44 +0000 |
commit | b3f70140e522f5eba8a4931adcc0ef520b432f47 (patch) | |
tree | e98f11af8585a6ad0f691c74d1b2642d3534e216 | |
parent | cbd8c2483b533dcb1efaf795326dbb87c78d20e8 (diff) | |
parent | 2f21dc50b4887f7397f0124245f4bdbf22241a81 (diff) | |
download | volse-hubzilla-b3f70140e522f5eba8a4931adcc0ef520b432f47.tar.gz volse-hubzilla-b3f70140e522f5eba8a4931adcc0ef520b432f47.tar.bz2 volse-hubzilla-b3f70140e522f5eba8a4931adcc0ef520b432f47.zip |
Merge branch 'dev' into 7.8RC
-rw-r--r-- | Zotlabs/Module/Poke.php | 31 | ||||
-rw-r--r-- | include/text.php | 36 |
2 files changed, 25 insertions, 42 deletions
diff --git a/Zotlabs/Module/Poke.php b/Zotlabs/Module/Poke.php index d60a7f426..596de58a3 100644 --- a/Zotlabs/Module/Poke.php +++ b/Zotlabs/Module/Poke.php @@ -3,6 +3,7 @@ namespace Zotlabs\Module; /** @file */ use App; use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Activity; use Zotlabs\Web\Controller; /** @@ -107,11 +108,6 @@ class Poke extends Controller { $deny_gid = (($item_private) ? '' : $channel['channel_deny_gid']); } - - $arr = array(); - - - $arr['item_wall'] = 1; $arr['owner_xchan'] = (($parent_item) ? $parent_item['owner_xchan'] : $channel['channel_hash']); $arr['parent_mid'] = (($parent_mid) ? $parent_mid : ''); @@ -122,26 +118,15 @@ class Poke extends Controller { $arr['deny_gid'] = $deny_gid; $arr['verb'] = $activity; $arr['item_private'] = $item_private; - $arr['obj_type'] = ACTIVITY_OBJ_PERSON; + $arr['obj_type'] = ACTIVITY_OBJ_NOTE; $arr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t($verbs[$verb][0]) . ' ' . '[zrl=' . $target['xchan_url'] . ']' . $target['xchan_name'] . '[/zrl]'; - - $obj = array( - 'type' => ACTIVITY_OBJ_PERSON, - 'title' => $target['xchan_name'], - 'id' => $target['xchan_hash'], - 'link' => array( - array('rel' => 'alternate', 'type' => 'text/html', 'href' => $target['xchan_url']), - array('rel' => 'photo', 'type' => $target['xchan_photo_mimetype'], 'href' => $target['xchan_photo_l']) - ), - ); - - $arr['obj'] = json_encode($obj); - $arr['item_origin'] = 1; $arr['item_wall'] = 1; $arr['item_unseen'] = 1; if(! $parent_item) - $item['item_thread_top'] = 1; + $arr['item_thread_top'] = 1; + + $arr['obj'] = Activity::encode_item($arr); post_activity_item($arr); @@ -198,8 +183,8 @@ class Poke extends Controller { $desc = t('Poke somebody'); } else { - $title = t('Poke/Prod'); - $desc = t('Poke, prod or do other things to somebody'); + $title = t('Poke'); + $desc = t('Poke or ping somebody'); } $o = replace_macros(get_markup_template('poke_content.tpl'),array( @@ -207,7 +192,7 @@ class Poke extends Controller { '$poke_basic' => $poke_basic, '$desc' => $desc, '$clabel' => t('Recipient'), - '$choice' => t('Choose what you wish to do to recipient'), + '$choice' => t('Choose action'), '$verbs' => $shortlist, '$parent' => $parent, '$prv_desc' => t('Make this post private'), diff --git a/include/text.php b/include/text.php index 3b21b04b6..37d185ce6 100644 --- a/include/text.php +++ b/include/text.php @@ -1254,26 +1254,24 @@ function sslify($s) { * * \e value is array containing past tense verb, translation of present, translation of past */ function get_poke_verbs() { - if (get_config('system', 'poke_basic')) { - $arr = array( - 'poke' => array('poked', t('poke'), t('poked')), - ); - } else { - $arr = array( - 'poke' => array( 'poked', t('poke'), t('poked')), - 'ping' => array( 'pinged', t('ping'), t('pinged')), - 'prod' => array( 'prodded', t('prod'), t('prodded')), - 'slap' => array( 'slapped', t('slap'), t('slapped')), - 'finger' => array( 'fingered', t('finger'), t('fingered')), - 'rebuff' => array( 'rebuffed', t('rebuff'), t('rebuffed')), - ); - /** - * @hooks poke_verbs - * * \e array associative array with another array as value - */ - call_hooks('poke_verbs', $arr); - } + $arr = [ + 'poke' => ['poked', t('poke'), t('poked')], + 'ping' => ['pinged', t('ping'), t('pinged')], + + // Those might be better suited for a nsfw poke addon + + // 'prod' => ['prodded', t('prod'), t('prodded')], + // 'slap' => ['slapped', t('slap'), t('slapped')], + // 'finger' => ['fingered', t('finger'), t('fingered')], + // 'rebuff' => ['rebuffed', t('rebuff'), t('rebuffed')] + ]; + + /** + * @hooks poke_verbs + * * \e array associative array with another array as value + */ + call_hooks('poke_verbs', $arr); return $arr; } |