aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorSebastian Egbers <sebastian@egbers.info>2012-06-25 15:53:56 +0200
committerSebastian Egbers <sebastian@egbers.info>2012-06-25 15:53:56 +0200
commitaf1d4bb632aa1f6c9fb9f756f1d8606f9fe947e1 (patch)
tree15bbb9a368af816b242a61281ecbfa80039a827b /include/api.php
parent020deedd7c68ce016b65056062d85567c91c3d37 (diff)
downloadvolse-hubzilla-af1d4bb632aa1f6c9fb9f756f1d8606f9fe947e1.tar.gz
volse-hubzilla-af1d4bb632aa1f6c9fb9f756f1d8606f9fe947e1.tar.bz2
volse-hubzilla-af1d4bb632aa1f6c9fb9f756f1d8606f9fe947e1.zip
modified api message reply to set title to conversion title, when replying.
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/api.php b/include/api.php
index 1db9d020b..2da183f01 100644
--- a/include/api.php
+++ b/include/api.php
@@ -1516,27 +1516,31 @@
$sender = api_get_user($a);
+ require_once("include/message.php");
+
$r = q("SELECT `id` FROM `contact` WHERE `uid`=%d AND `nick`='%s'",
intval(local_user()),
dbesc($_POST['screen_name']));
-
- require_once("include/message.php");
$recipient = api_get_user($a, $r[0]['id']);
$replyto = '';
+ $sub = '';
if (x($_REQUEST,'replyto')) {
- $r = q('SELECT `uri` FROM `mail` WHERE `uid`=%d AND `id`=%d',
+ $r = q('SELECT `uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d',
intval(local_user()),
intval($_REQUEST['replyto']));
$replyto = $r[0]['uri'];
- }
-
- if (x($_REQUEST,'title')) {
- $sub = $_REQUEST['title'];
+ $sub = $r[0]['title'];
}
else {
- $sub = ((strlen($_POST['text'])>10)?substr($_POST['text'],0,10)."...":$_POST['text']);
+ if (x($_REQUEST,'title')) {
+ $sub = $_REQUEST['title'];
+ }
+ else {
+ $sub = ((strlen($_POST['text'])>10)?substr($_POST['text'],0,10)."...":$_POST['text']);
+ }
}
+
$id = send_message($recipient['id'], $_POST['text'], $sub, $replyto);
if ($id>-1) {