aboutsummaryrefslogtreecommitdiffstats
path: root/mod/post.php
diff options
context:
space:
mode:
authorhabeascodice <habeascodice@federated.social>2014-11-01 03:04:11 -0700
committerhabeascodice <habeascodice@federated.social>2014-11-01 03:04:11 -0700
commit31376de0665091f2dba04755562ccd238d57a13c (patch)
treeae59c8697b9fd20c33aeaf8acb3a698b63e9657b /mod/post.php
parentc854f8c238da2df08b52249142ad24ef66e422d1 (diff)
parent50c16c394fe2d966c62d30930600212a4e33303e (diff)
downloadvolse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.tar.gz
volse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.tar.bz2
volse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'mod/post.php')
-rw-r--r--mod/post.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/mod/post.php b/mod/post.php
index d62233ca1..c21af83e4 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -507,6 +507,7 @@ function post_post(&$a) {
json_return_and_die($ret);
}
+
if($msgtype === 'pickup') {
/**
@@ -597,11 +598,24 @@ function post_post(&$a) {
$ret['success'] = true;
$ret['pickup'] = array();
foreach($r as $rr) {
- $ret['pickup'][] = array('notify' => json_decode($rr['outq_notify'],true),'message' => json_decode($rr['outq_msg'],true));
+ if($rr['outq_msg']) {
+ $x = json_decode($rr['outq_msg'],true);
- $x = q("delete from outq where outq_hash = '%s' limit 1",
- dbesc($rr['outq_hash'])
- );
+ if(! $x)
+ continue;
+
+ if(array_key_exists('message_list',$x)) {
+ foreach($x['message_list'] as $xx) {
+ $ret['pickup'][] = array('notify' => json_decode($rr['outq_notify'],true),'message' => $xx);
+ }
+ }
+ else
+ $ret['pickup'][] = array('notify' => json_decode($rr['outq_notify'],true),'message' => $x);
+
+ $x = q("delete from outq where outq_hash = '%s' limit 1",
+ dbesc($rr['outq_hash'])
+ );
+ }
}
}
@@ -796,6 +810,12 @@ function post_post(&$a) {
json_return_and_die($ret);
}
+ if($msgtype === 'request') {
+ // request a particular post/conversation by message_id
+ $x = zot_process_message_request($data);
+ json_return_and_die($x);
+ }
+
if($msgtype === 'purge') {
if($recipients) {