From b62eb665c5ad12ec7bde6bace71a0ddbb6aac28d Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 22 Nov 2019 14:11:26 +0000 Subject: sse: store the item mid plus reactions mids in data-mids and change functions accordingly --- include/conversation.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e2dd02ffc..95eb1daad 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1172,6 +1172,9 @@ function builtin_activity_puller($item, &$conv_responses) { if(! $item['thr_parent']) $item['thr_parent'] = $item['parent_mid']; + + $conv_responses[$mode]['mids'][$item['thr_parent']][] = 'b64.' . base64url_encode($item['mid']); + if(! ((isset($conv_responses[$mode][$item['thr_parent'] . '-l'])) && (is_array($conv_responses[$mode][$item['thr_parent'] . '-l'])))) $conv_responses[$mode][$item['thr_parent'] . '-l'] = array(); -- cgit v1.2.3 From c1aa96ebf70fd5b6426d96bf7d7e771dfc4ca9ab Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 29 Nov 2019 19:46:13 +0000 Subject: sse: template fixes, fix missing forum notifications and minor impovements --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 95eb1daad..e8b8051bb 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -736,6 +736,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa 'delete' => t('Delete'), 'preview_lbl' => $preview_lbl, 'id' => (($preview) ? 'P0' : $item['item_id']), + 'mids' => json_encode(['b64.' . base64url_encode($item['mid'])]), 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url), 'profile_url' => $profile_link, 'thread_action_menu' => thread_action_menu($item,$mode), -- cgit v1.2.3 From 5c4301369235b7f03a4654e81ded6b9da3b98891 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 9 Jan 2020 08:20:01 +0000 Subject: deal with situations where we do not have an xchan_addr but only an xchan_url --- include/conversation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e8b8051bb..a80adb933 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1010,11 +1010,11 @@ function thread_author_menu($item, $mode = '') { $contact = App::$contacts[$item['author_xchan']]; } else { - if($local_channel && $item['author']['xchan_addr'] && (! in_array($item['author']['xchan_network'],[ 'rss', 'anon','unknown' ]))) { - $follow_url = z_root() . '/follow/?f=&url=' . urlencode($item['author']['xchan_addr']) . '&interactive=0'; + $url = (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']); + if($local_channel && $url && (! in_array($item['author']['xchan_network'],[ 'rss', 'anon','unknown' ]))) { + $follow_url = z_root() . '/follow/?f=&url=' . urlencode($url) . '&interactive=0'; } } - if($item['uid'] > 0 && author_is_pmable($item['author'],$contact)) { $pm_url = z_root() . '/mail/new/?f=&hash=' . urlencode($item['author_xchan']); } -- cgit v1.2.3 From 7404a8ec1a0980fa3448ca6b05e410ea36c6a5f2 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 18 Jan 2020 14:19:31 +0000 Subject: implement bdi tags via bbcode where possible --- include/conversation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a80adb933..1aa34ae85 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -172,9 +172,9 @@ function localize_item(&$item){ $shortbodyverb = t('doesn\'t like %1$s\'s %2$s'); } - $item['shortlocalize'] = sprintf($shortbodyverb, $objauthor, $plink); + $item['shortlocalize'] = sprintf($shortbodyverb, '[bdi]' . $objauthor . '[/bdi]', $plink); - $item['body'] = $item['localize'] = sprintf($bodyverb, $author, $objauthor, $plink); + $item['body'] = $item['localize'] = sprintf($bodyverb, '[bdi]' . $author . '[/bdi]', '[bdi]' . $objauthor . '[/bdi]', $plink); if($Bphoto != "") $item['body'] .= "\n\n\n" . '[zrl=' . chanlink_url($author_link) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; -- cgit v1.2.3 From 570d84c031d9cdf0e16aa79bc4a7a111345cc3f3 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 18 Jan 2020 16:04:40 +0000 Subject: fix shortlocalize --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 1aa34ae85..3c86bef3c 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -172,7 +172,7 @@ function localize_item(&$item){ $shortbodyverb = t('doesn\'t like %1$s\'s %2$s'); } - $item['shortlocalize'] = sprintf($shortbodyverb, '[bdi]' . $objauthor . '[/bdi]', $plink); + $item['shortlocalize'] = sprintf($shortbodyverb, '[bdi]' . $author_name . '[/bdi]', $post_type); $item['body'] = $item['localize'] = sprintf($bodyverb, '[bdi]' . $author . '[/bdi]', '[bdi]' . $objauthor . '[/bdi]', $plink); if($Bphoto != "") -- cgit v1.2.3 From 7973567a7c9ef531f1e3877066dab71599895e0d Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 20 Jan 2020 09:30:24 +0000 Subject: more shortlocalize and bdi tags --- include/conversation.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 3c86bef3c..07d43e660 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -205,10 +205,12 @@ function localize_item(&$item){ $Bname = $obj['title']; - $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; - $B = '[zrl=' . chanlink_url($Blink) . ']' . $Bname . '[/zrl]'; + $A = '[zrl=' . chanlink_url($Alink) . '][bdi]' . $Aname . '[/bdi][/zrl]'; + $B = '[zrl=' . chanlink_url($Blink) . '][bdi]' . $Bname . '[/bdi][/zrl]'; if ($Bphoto!="") $Bphoto = '[zrl=' . chanlink_url($Blink) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; + $item['shortlocalize'] = sprintf( t('%1$s is now connected with %2$s'), '[bdi]' . $Aname . '[/bdi]', '[bdi]' . $Bname . '[/bdi]'); + $item['body'] = $item['localize'] = sprintf( t('%1$s is now connected with %2$s'), $A, $B); $item['body'] .= "\n\n\n" . $Bphoto; } @@ -237,8 +239,8 @@ function localize_item(&$item){ } $Bname = $obj['title']; - $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; - $B = '[zrl=' . chanlink_url($Blink) . ']' . $Bname . '[/zrl]'; + $A = '[zrl=' . chanlink_url($Alink) . '][bdi]' . $Aname . '[/bdi][/zrl]'; + $B = '[zrl=' . chanlink_url($Blink) . '][bdi]' . $Bname . '[/bdi][/zrl]'; if ($Bphoto!="") $Bphoto = '[zrl=' . chanlink_url($Blink) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]'; // we can't have a translation string with three positions but no distinguishable text @@ -252,6 +254,8 @@ function localize_item(&$item){ // then do the sprintf on the translation string + $item['shortlocalize'] = sprintf($txt, '[bdi]' . $Aname . '[/bdi]', '[bdi]' . $Bname . '[/bdi]'); + $item['body'] = $item['localize'] = sprintf($txt, $A, $B); $item['body'] .= "\n\n\n" . $Bphoto; } @@ -263,7 +267,7 @@ function localize_item(&$item){ $Aname = $item['author']['xchan_name']; $Alink = $item['author']['xchan_url']; - $A = '[zrl=' . chanlink_url($Alink) . ']' . $Aname . '[/zrl]'; + $A = '[zrl=' . chanlink_url($Alink) . '][bdi]' . $Aname . '[/bdi][/zrl]'; $txt = t('%1$s is %2$s','mood'); -- cgit v1.2.3 From 989443a5698adf5e7a93f874048699526aa103a7 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 30 Jan 2020 15:56:33 -0800 Subject: basic poll support and patch to not call System::get_platform_name() within t() unless needed. Polls probably need refining and have not yet been fully tested after porting --- include/conversation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 07d43e660..45b2b4d80 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -408,7 +408,7 @@ function count_descendants($item) { * @return boolean */ function visible_activity($item) { - $hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_POLLRESPONSE ]; + $hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_POLLRESPONSE, 'Answer' ]; if(intval($item['item_notshown'])) return false; @@ -419,6 +419,8 @@ function visible_activity($item) { } } + + if(is_edit_activity($item)) return false; -- cgit v1.2.3 From bbcb237f5b996e94af37611152105b2e965ea493 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 9 Feb 2020 16:32:18 -0800 Subject: poll updates --- include/conversation.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 45b2b4d80..327d89e53 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -408,11 +408,15 @@ function count_descendants($item) { * @return boolean */ function visible_activity($item) { - $hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_POLLRESPONSE, 'Answer' ]; + $hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_POLLRESPONSE ]; if(intval($item['item_notshown'])) return false; + if ($item['obj_type'] === 'Answer') { + return false; + } + foreach($hidden_activities as $act) { if((activity_match($item['verb'], $act)) && ($item['mid'] != $item['parent_mid'])) { return false; -- cgit v1.2.3 From 9f029336cab322e04d29af842ba0a666189c8683 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 11 Feb 2020 09:20:32 +0000 Subject: fix notifications for polls --- include/conversation.php | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 327d89e53..0098a694d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -625,11 +625,17 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa $items = $cb['items']; - $conv_responses = array( - 'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')), - 'agree' => array('title' => t('Agree','title')),'disagree' => array('title' => t('Disagree','title')), 'abstain' => array('title' => t('Abstain','title')), - 'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title')) - ); + $conv_responses = [ + 'like' => ['title' => t('Likes','title')], + 'dislike' => ['title' => t('Dislikes','title')], + 'agree' => ['title' => t('Agree','title')], + 'disagree' => ['title' => t('Disagree','title')], + 'abstain' => ['title' => t('Abstain','title')], + 'attendyes' => ['title' => t('Attending','title')], + 'attendno' => ['title' => t('Not attending','title')], + 'attendmaybe' => ['title' => t('Might attend','title')], + 'answer' => [] + ]; // array with html for each thread (parent+comments) @@ -1136,7 +1142,7 @@ function builtin_activity_puller($item, &$conv_responses) { // if this item is a post or comment there's nothing for us to do here, just return. - if(activity_match($item['verb'],ACTIVITY_POST)) + if(activity_match($item['verb'],ACTIVITY_POST) && $item['obj_type'] !== 'Answer') return; foreach($conv_responses as $mode => $v) { @@ -1168,6 +1174,9 @@ function builtin_activity_puller($item, &$conv_responses) { case 'attendmaybe': $verb = ACTIVITY_ATTENDMAYBE; break; + case 'answer': + $verb = ACTIVITY_POST; + break; default: return; break; @@ -1183,9 +1192,11 @@ function builtin_activity_puller($item, &$conv_responses) { if(! $item['thr_parent']) $item['thr_parent'] = $item['parent_mid']; - $conv_responses[$mode]['mids'][$item['thr_parent']][] = 'b64.' . base64url_encode($item['mid']); + if($item['obj_type'] === 'Answer') + continue; + if(! ((isset($conv_responses[$mode][$item['thr_parent'] . '-l'])) && (is_array($conv_responses[$mode][$item['thr_parent'] . '-l'])))) $conv_responses[$mode][$item['thr_parent'] . '-l'] = array(); -- cgit v1.2.3 From e7f25b84664c158343621c391b8653042d5be53c Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 26 Feb 2020 09:51:40 +0000 Subject: implement poll UI in jot --- include/conversation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 0098a694d..ba0f61196 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1293,7 +1293,7 @@ function hz_status_editor($a, $x, $popup = false) { $feature_voting = feature_enabled($x['profile_uid'], 'consensus_tools'); if(x($x, 'hide_voting')) $feature_voting = false; - + $feature_nocomment = feature_enabled($x['profile_uid'], 'disable_comments'); if(x($x, 'disable_comments')) $feature_nocomment = false; @@ -1441,6 +1441,8 @@ function hz_status_editor($a, $x, $popup = false) { '$embedPhotosModalOK' => t('OK'), '$setloc' => $setloc, '$voting' => t('Toggle voting'), + '$poll' => t('Toggle poll'), + '$multiple_answers' => ['poll_multiple_answers', t("Allow multiple answers")], '$feature_voting' => $feature_voting, '$consensus' => ((array_key_exists('item',$x)) ? $x['item']['item_consensus'] : 0), '$nocommenttitle' => t('Disable comments'), -- cgit v1.2.3 From a574290235b840e56c2f0b3a3c37b9050f02e45b Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 28 Feb 2020 13:22:30 +0000 Subject: poll UI strings --- include/conversation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index ba0f61196..62d4b405f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1442,7 +1442,10 @@ function hz_status_editor($a, $x, $popup = false) { '$setloc' => $setloc, '$voting' => t('Toggle voting'), '$poll' => t('Toggle poll'), - '$multiple_answers' => ['poll_multiple_answers', t("Allow multiple answers")], + '$poll_option_label' => t('Option'), + '$poll_add_option_label' => t('Add option'), + '$poll_expire_unit_label' => [t('Minutes'), t('Hours'), t('Days')], + '$multiple_answers' => ['poll_multiple_answers', t("Allow multiple answers"), '', '', [t('No'), t('Yes')]], '$feature_voting' => $feature_voting, '$consensus' => ((array_key_exists('item',$x)) ? $x['item']['item_consensus'] : 0), '$nocommenttitle' => t('Disable comments'), -- cgit v1.2.3 From 806c738923b9d880af49a1811d8fbf2c2ee36309 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 8 Apr 2020 18:41:54 +0000 Subject: remove voting from UI in favour of polls --- include/conversation.php | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 62d4b405f..49dd411fb 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1287,13 +1287,6 @@ function hz_status_editor($a, $x, $popup = false) { $plaintext = true; -// if(feature_enabled(local_channel(),'richtext')) -// $plaintext = false; - - $feature_voting = feature_enabled($x['profile_uid'], 'consensus_tools'); - if(x($x, 'hide_voting')) - $feature_voting = false; - $feature_nocomment = feature_enabled($x['profile_uid'], 'disable_comments'); if(x($x, 'disable_comments')) $feature_nocomment = false; @@ -1446,7 +1439,6 @@ function hz_status_editor($a, $x, $popup = false) { '$poll_add_option_label' => t('Add option'), '$poll_expire_unit_label' => [t('Minutes'), t('Hours'), t('Days')], '$multiple_answers' => ['poll_multiple_answers', t("Allow multiple answers"), '', '', [t('No'), t('Yes')]], - '$feature_voting' => $feature_voting, '$consensus' => ((array_key_exists('item',$x)) ? $x['item']['item_consensus'] : 0), '$nocommenttitle' => t('Disable comments'), '$nocommenttitlesub' => t('Toggle comments'), -- cgit v1.2.3 From 52e698cae6794ce92c249fd365f6035f88382688 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 12 Apr 2020 07:05:01 +0000 Subject: function is_edit_activity() is obsolete --- include/conversation.php | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 49dd411fb..a78ee1704 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -423,35 +423,9 @@ function visible_activity($item) { } } - - - if(is_edit_activity($item)) - return false; - return true; } -/** - * @brief Check if a given activity is an edit activity - * - * - * @param array $item - * @return boolean - */ - -function is_edit_activity($item) { - - $post_types = [ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT, basename(ACTIVITY_OBJ_NOTE), basename(ACTIVITY_OBJ_COMMENT)]; - - // In order to share edits with networks which have no concept of editing, we'll create - // separate activities to indicate the edit. Our network will not require them, since our - // edits are automatically applied and the activity indicated. - - if(($item['verb'] === ACTIVITY_UPDATE) && (in_array($item['obj_type'],$post_types))) - return true; - - return false; -} /** * @brief "Render" a conversation or list of items for HTML display. -- cgit v1.2.3 From 27ae9c9d343fec96f117d5c4940d2221bc7cfd55 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 12 Apr 2020 07:35:17 +0000 Subject: just comment out is_edit_activity() call and add comments on why it is commented out --- include/conversation.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a78ee1704..b0e81b7e2 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -423,9 +423,43 @@ function visible_activity($item) { } } + // We only need edit activities for other federated protocols + // which do not support edits natively. While this does federate + // edits, it presents a number of issues locally - such as #757 and #758. + // The SQL check for an edit activity would not perform that well so to fix these issues + // requires an additional item flag (perhaps 'item_edit_activity') that we can add to the + // query for searches and notifications. + + // For now we'll just forget about trying to make edits work on network protocols that + // don't support them. + + // if(is_edit_activity($item)) + // return false; + return true; } +/** + * @brief Check if a given activity is an edit activity + * + * + * @param array $item + * @return boolean + */ + +function is_edit_activity($item) { + + $post_types = [ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT, basename(ACTIVITY_OBJ_NOTE), basename(ACTIVITY_OBJ_COMMENT)]; + + // In order to share edits with networks which have no concept of editing, we'll create + // separate activities to indicate the edit. Our network will not require them, since our + // edits are automatically applied and the activity indicated. + + if(($item['verb'] === ACTIVITY_UPDATE) && (in_array($item['obj_type'],$post_types))) + return true; + + return false; +} /** * @brief "Render" a conversation or list of items for HTML display. -- cgit v1.2.3 From c4c47f777724937746c99c064e65f52723443e59 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 20 Aug 2020 22:47:33 +0200 Subject: first cut on implementing additional encryption with the SJCL library. aes only and no backward compatibility. --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index b0e81b7e2..05d1cdc26 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1396,7 +1396,7 @@ function hz_status_editor($a, $x, $popup = false) { $cipher = get_pconfig($x['profile_uid'], 'system', 'default_cipher'); if(! $cipher) - $cipher = 'aes256'; + $cipher = 'AES-256'; if(array_key_exists('catsenabled',$x)) $catsenabled = $x['catsenabled']; -- cgit v1.2.3 From 49df57df45f82e2e0f1b10f2508f61b78d6d3ac0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 21 Aug 2020 10:55:55 +0200 Subject: use the default setting and also add the mode to the cipher. aes-128 is to be preferred over aes-256 according to bruce schneier https://www.schneier.com/blog/archives/2009/07/another_new_aes.html#c386957 --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 05d1cdc26..876e907e5 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1396,7 +1396,7 @@ function hz_status_editor($a, $x, $popup = false) { $cipher = get_pconfig($x['profile_uid'], 'system', 'default_cipher'); if(! $cipher) - $cipher = 'AES-256'; + $cipher = 'AES-128-CCM'; if(array_key_exists('catsenabled',$x)) $catsenabled = $x['catsenabled']; -- cgit v1.2.3 From 170b2e4465951edff5019545045714aa660cad51 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 22 Aug 2020 22:44:00 +0200 Subject: only show poke link if poke app is installed --- include/conversation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 876e907e5..b43a6f47e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1,5 +1,7 @@ Date: Sat, 10 Oct 2020 08:00:25 +0000 Subject: quickfix localize_item() - requires more work --- include/conversation.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index b43a6f47e..c8c36f241 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -104,20 +104,30 @@ function localize_item(&$item){ if($obj['author'] && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); + elseif($obj['actor'] && $obj['actor']['url']) + $author_link = $obj['actor']['url'][0]['href']; else $author_link = ''; $author_name = (($obj['author'] && $obj['author']['name']) ? $obj['author']['name'] : ''); + if(!$author_name) + $author_name = (($obj['actor'] && $obj['actor']['name']) ? $obj['actor']['name'] : ''); + $item_url = get_rel_link($obj['link'],'alternate'); + if(!$item_url) + $item_url = $obj['id']; + $Bphoto = ''; switch($obj['type']) { case ACTIVITY_OBJ_PHOTO: + case 'Photo': $post_type = t('photo'); break; case ACTIVITY_OBJ_EVENT: + case 'Event': $post_type = t('event'); break; case ACTIVITY_OBJ_PERSON: @@ -142,9 +152,10 @@ function localize_item(&$item){ break; case ACTIVITY_OBJ_NOTE: + case 'Note': default: - $post_type = t('status'); - if($obj['id'] != $obj['parent']) + $post_type = t('post'); + if(($obj['parent'] && $obj['id'] != $obj['parent']) || $obj['inReplyTo']) $post_type = t('comment'); break; } -- cgit v1.2.3 From 375986437ab94d3e25bb829409971adc89d4bdf9 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 12 Oct 2020 20:58:30 +0000 Subject: fix php warnings --- include/conversation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index c8c36f241..0be50ce26 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -104,15 +104,15 @@ function localize_item(&$item){ if($obj['author'] && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); - elseif($obj['actor'] && $obj['actor']['url']) - $author_link = $obj['actor']['url'][0]['href']; + elseif(is_array($obj['actor']) && $obj['actor']['url']) + $author_link = ((is_array($obj['actor']['url']) ? $obj['actor']['url'][0]['href'] : $obj['actor']['url']); else $author_link = ''; $author_name = (($obj['author'] && $obj['author']['name']) ? $obj['author']['name'] : ''); if(!$author_name) - $author_name = (($obj['actor'] && $obj['actor']['name']) ? $obj['actor']['name'] : ''); + $author_name = ((is_array($obj['actor']) && $obj['actor']['name']) ? $obj['actor']['name'] : ''); $item_url = get_rel_link($obj['link'],'alternate'); -- cgit v1.2.3 From 31e030af69bd5e542dff45b299718f6c12b08467 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 12 Oct 2020 21:01:36 +0000 Subject: missing parenthesis --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 0be50ce26..48a72aa21 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -105,7 +105,7 @@ function localize_item(&$item){ if($obj['author'] && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); elseif(is_array($obj['actor']) && $obj['actor']['url']) - $author_link = ((is_array($obj['actor']['url']) ? $obj['actor']['url'][0]['href'] : $obj['actor']['url']); + $author_link = ((is_array($obj['actor']['url'])) ? $obj['actor']['url'][0]['href'] : $obj['actor']['url']); else $author_link = ''; -- cgit v1.2.3 From 8cd67a5d4a7072034df581e8ce212f1d24055348 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 12 Oct 2020 21:37:44 +0000 Subject: fix more php warnings and remove temporary logging --- include/conversation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 48a72aa21..e77404cff 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -102,7 +102,7 @@ function localize_item(&$item){ logger('localize_item: failed to decode object: ' . print_r($item['obj'],true)); } - if($obj['author'] && $obj['author']['link']) + if(is_array($obj['author']) && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); elseif(is_array($obj['actor']) && $obj['actor']['url']) $author_link = ((is_array($obj['actor']['url'])) ? $obj['actor']['url'][0]['href'] : $obj['actor']['url']); @@ -114,7 +114,8 @@ function localize_item(&$item){ if(!$author_name) $author_name = ((is_array($obj['actor']) && $obj['actor']['name']) ? $obj['actor']['name'] : ''); - $item_url = get_rel_link($obj['link'],'alternate'); + if(is_array($obj['link'])) + $item_url = get_rel_link($obj['link'],'alternate'); if(!$item_url) $item_url = $obj['id']; -- cgit v1.2.3