aboutsummaryrefslogtreecommitdiffstats
path: root/mod/message.php
diff options
context:
space:
mode:
authorTobias Hößl <tobias@hoessl.eu>2012-03-11 11:27:47 +0000
committerTobias Hößl <tobias@hoessl.eu>2012-03-11 11:27:47 +0000
commit4df08433c6dcf5c88945e064da74188c805c5d68 (patch)
treeee482f76941fbb26b77a53147def83b32c8eaa7b /mod/message.php
parent635958e11da2f5a0d587b66968453064c2d41f13 (diff)
parent50863a19eb9c74ca336df609dbb9dfe5a9c39a31 (diff)
downloadvolse-hubzilla-4df08433c6dcf5c88945e064da74188c805c5d68.tar.gz
volse-hubzilla-4df08433c6dcf5c88945e064da74188c805c5d68.tar.bz2
volse-hubzilla-4df08433c6dcf5c88945e064da74188c805c5d68.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/message.php')
-rwxr-xr-xmod/message.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/mod/message.php b/mod/message.php
index 9226a68fb..37f92e8d9 100755
--- a/mod/message.php
+++ b/mod/message.php
@@ -10,17 +10,19 @@ function message_post(&$a) {
return;
}
- $replyto = ((x($_POST,'replyto')) ? notags(trim($_POST['replyto'])) : '');
- $subject = ((x($_POST,'subject')) ? notags(trim($_POST['subject'])) : '');
- $body = ((x($_POST,'body')) ? escape_tags(trim($_POST['body'])) : '');
- $recipient = ((x($_POST,'messageto')) ? intval($_POST['messageto']) : 0 );
+ $replyto = ((x($_REQUEST,'replyto')) ? notags(trim($_REQUEST['replyto'])) : '');
+ $subject = ((x($_REQUEST,'subject')) ? notags(trim($_REQUEST['subject'])) : '');
+ $body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
+ $recipient = ((x($_REQUEST,'messageto')) ? intval($_REQUEST['messageto']) : 0 );
$ret = send_message($recipient, $body, $subject, $replyto);
+ $norecip = false;
switch($ret){
case -1:
notice( t('No recipient selected.') . EOL );
+ $norecip = true;
break;
case -2:
notice( t('Unable to locate contact information.') . EOL );
@@ -35,6 +37,13 @@ function message_post(&$a) {
info( t('Message sent.') . EOL );
}
+ // fake it to go back to the input form if no recipient listed
+
+ if($norecip) {
+ $a->argc = 2;
+ $a->argv[1] = 'new';
+ }
+
}
function message_content(&$a) {
@@ -151,7 +160,8 @@ function message_content(&$a) {
'$header' => t('Send Private Message'),
'$to' => t('To:'),
'$subject' => t('Subject:'),
- '$subjtxt' => '',
+ '$subjtxt' => ((x($_REQUEST,'subject')) ? strip_tags($_REQUEST['subject']) : ''),
+ '$text' => ((x($_REQUEST,'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
'$readonly' => '',
'$yourmessage' => t('Your message:'),
'$select' => $select,
@@ -295,6 +305,7 @@ function message_content(&$a) {
'$subjtxt' => template_escape($message['title']),
'$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
'$yourmessage' => t('Your message:'),
+ '$text' => '',
'$select' => $select,
'$parent' => $parent,
'$upload' => t('Upload photo'),