aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-14 22:54:16 -0800
committerfriendica <info@friendica.com>2013-11-14 22:54:16 -0800
commit2fe6aef8bc41db07cfac094f9ede7b06a52e0ade (patch)
treeedd827bcad66c10aed035f24f6aaa946d0379fd8
parentfa79085bd57877a38139a6c656150e68bc2e8255 (diff)
downloadvolse-hubzilla-2fe6aef8bc41db07cfac094f9ede7b06a52e0ade.tar.gz
volse-hubzilla-2fe6aef8bc41db07cfac094f9ede7b06a52e0ade.tar.bz2
volse-hubzilla-2fe6aef8bc41db07cfac094f9ede7b06a52e0ade.zip
fix default cipher for comments and set it at the conversation level rather than the item level.
-rw-r--r--include/ConversationObject.php9
-rw-r--r--include/ItemObject.php9
-rwxr-xr-xview/tpl/comment_item.tpl2
3 files changed, 11 insertions, 9 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php
index d8c6bca77..103c3664b 100644
--- a/include/ConversationObject.php
+++ b/include/ConversationObject.php
@@ -23,7 +23,7 @@ class Conversation extends BaseObject {
private $profile_owner = 0;
private $preview = false;
private $prepared_item = '';
-
+ private $cipher = 'aes256';
// $prepared_item is for use by alternate conversation structures such as photos
// wherein we've already prepared a top level item which doesn't look anything like
@@ -33,6 +33,9 @@ class Conversation extends BaseObject {
$this->set_mode($mode);
$this->preview = $preview;
$this->prepared_item = $prepared_item;
+ $c = ((local_user()) ? get_pconfig(local_user(),'system','default_cipher') : '');
+ if($c)
+ $this->cipher = $c;
}
/**
@@ -118,6 +121,10 @@ class Conversation extends BaseObject {
return $this->observer;
}
+ public function get_cipher() {
+ return $this->cipher;
+ }
+
/**
* Add a thread to the conversation
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 6dbb38564..6088a2c1c 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -27,7 +27,7 @@ class Item extends BaseObject {
private $threaded = false;
private $visiting = false;
private $channel = null;
- private $cipher = 'aes256';
+
public function __construct($data) {
$a = $this->get_app();
@@ -35,11 +35,6 @@ class Item extends BaseObject {
$this->data = $data;
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
- $cipher = get_pconfig($x['profile_uid'],'system','default_cipher');
- if($cipher)
- $this->cipher = $cipher;
-
-
// Prepare the children
if(count($data['children'])) {
foreach($data['children'] as $item) {
@@ -545,7 +540,7 @@ class Item extends BaseObject {
'$indent' => $indent,
'$feature_encrypt' => ((feature_enabled($conv->get_profile_owner(),'content_encrypt')) ? true : false),
'$encrypt' => t('Encrypt text'),
- '$cipher' => $this->cipher,
+ '$cipher' => $conv->get_cipher(),
'$sourceapp' => get_app()->sourcename
));
diff --git a/view/tpl/comment_item.tpl b/view/tpl/comment_item.tpl
index fb08624f2..b8e2b4730 100755
--- a/view/tpl/comment_item.tpl
+++ b/view/tpl/comment_item.tpl
@@ -43,7 +43,7 @@
{{if $feature_encrypt}}
<li><i class="icon-key shadow comment-icon"
style="cursor: pointer;" title="{{$encrypt}}"
- onclick="red_encrypt('{{$cipher}}','#comment-edit-text-' + {{$id}},''); return false;"></i></li>
+ onclick="red_encrypt('{{$cipher}}','#comment-edit-text-' + '{{$id}}',''); return false;"></i></li>
{{/if}}
</ul>
<div class="comment-edit-bb-end"></div>