E2EE on private mail (also fixed autocomplete results dropdown for recipient which was positioned below the navbar instead of next to the recipient input box)

This commit is contained in:
friendica 2013-11-13 23:10:29 -08:00
parent 412ebdade7
commit ee629534d5
4 changed files with 22 additions and 8 deletions

View File

@ -76,12 +76,12 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto='
$match = null; $match = null;
$images = null; $images = null;
if(preg_match_all("/\[img\](.*?)\[\/img\]/",$body,$match)) if(preg_match_all("/\[img\](.*?)\[\/img\]/",((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$match))
$images = $match[1]; $images = $match[1];
$match = false; $match = false;
if(preg_match_all("/\[attachment\](.*?)\[\/attachment\]/",$body,$match)) if(preg_match_all("/\[attachment\](.*?)\[\/attachment\]/",((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$match))
$attaches = $match[1]; $attaches = $match[1];
$attachments = ''; $attachments = '';

View File

@ -212,6 +212,12 @@ function message_content(&$a) {
$channel = $a->get_channel(); $channel = $a->get_channel();
head_set_icon($channel['xchan_photo_s']); head_set_icon($channel['xchan_photo_s']);
$cipher = get_pconfig(local_user(),'system','default_cipher');
if(! $cipher)
$cipher = 'aes256';
$tpl = get_markup_template('mail_head.tpl'); $tpl = get_markup_template('mail_head.tpl');
$header = replace_macros($tpl, array( $header = replace_macros($tpl, array(
'$messages' => t('Messages'), '$messages' => t('Messages'),
@ -328,6 +334,11 @@ function message_content(&$a) {
'$defexpire' => '', '$defexpire' => '',
'$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? 'block' : 'none'), '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? 'block' : 'none'),
'$expires' => t('Set expiration date'), '$expires' => t('Set expiration date'),
'$feature_encrypt' => ((feature_enabled(local_user(),'content_encrypt')) ? 'block' : 'none'),
'$encrypt' => t('Encrypt text'),
'$cipher' => $cipher,
)); ));
return $o; return $o;
@ -506,6 +517,10 @@ function message_content(&$a) {
'$defexpire' => '', '$defexpire' => '',
'$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? 'block' : 'none'), '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? 'block' : 'none'),
'$expires' => t('Set expiration date'), '$expires' => t('Set expiration date'),
'$feature_encrypt' => ((feature_enabled(local_user(),'content_encrypt')) ? 'block' : 'none'),
'$encrypt' => t('Encrypt text'),
'$cipher' => $cipher,
)); ));
return $o; return $o;

View File

@ -1721,6 +1721,7 @@ tr.mceLast {
#prvmail-attach-wrapper, #prvmail-attach-wrapper,
#prvmail-link-wrapper, #prvmail-link-wrapper,
#prvmail-expire-wrapper, #prvmail-expire-wrapper,
#prvmail-encrypt-wrapper,
#prvmail-rotator-wrapper { #prvmail-rotator-wrapper {
float: left; float: left;
margin-top: 10px; margin-top: 10px;
@ -2897,11 +2898,6 @@ div.jGrowl div.info {
} }
.autocomplete-w1 {
position: fixed;
top: 24px;
}
.autocomplete { .autocomplete {
color: $font_colour; color: $font_colour;
border: 1px solid $nav_bg_1; border: 1px solid $nav_bg_1;

View File

@ -15,6 +15,7 @@
{{/if}} {{/if}}
<input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" /> <input type="hidden" id="inp-prvmail-expires" name="expires" value="{{$defexpire}}" />
<input type="hidden" name="media_str" id="jot-media" value="" />
<div id="prvmail-subject-label">{{$subject}}</div> <div id="prvmail-subject-label">{{$subject}}</div>
<input type="text" size="64" maxlength="255" id="prvmail-subject" name="subject" value="{{$subjtxt}}" {{$readonly}} tabindex="11" /> <input type="text" size="64" maxlength="255" id="prvmail-subject" name="subject" value="{{$subjtxt}}" {{$readonly}} tabindex="11" />
@ -40,7 +41,9 @@
<div id="prvmail-expire-wrapper" style="display: {{$feature_expire}};" > <div id="prvmail-expire-wrapper" style="display: {{$feature_expire}};" >
<i id="prvmail-expires" class="icon-eraser jot-icons" title="{{$expires}}" onclick="prvmailGetExpiry();return false;"></i> <i id="prvmail-expires" class="icon-eraser jot-icons" title="{{$expires}}" onclick="prvmailGetExpiry();return false;"></i>
</div> </div>
<div id="prvmail-encrypt-wrapper" style="display: {{$feature_encrypt}};" >
<i id="prvmail-encrypt" class="icon-key jot-icons" title="{{$encrypt}}" onclick="red_encrypt('{{$cipher}}','#prvmail-text',$('#prvmail-text').val());return false;"></i>
</div>
<div id="prvmail-rotator-wrapper" > <div id="prvmail-rotator-wrapper" >
<img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" /> <img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />