aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-29 17:42:31 -0700
committerzotlabs <mike@macgirvin.com>2017-03-29 17:42:31 -0700
commitb51ca4c8d3a36ed49582c4fe894944869b0d42a2 (patch)
treeb47d44211a89f709261e67d73047a4956cf683bd
parent198d2ab607a609b5265dcbed5e41e62d431b19c2 (diff)
downloadvolse-hubzilla-b51ca4c8d3a36ed49582c4fe894944869b0d42a2.tar.gz
volse-hubzilla-b51ca4c8d3a36ed49582c4fe894944869b0d42a2.tar.bz2
volse-hubzilla-b51ca4c8d3a36ed49582c4fe894944869b0d42a2.zip
circular logic - we need the mailbox to find the last message so move the code block back where it was, and only set a direct mid if one was specified.
-rw-r--r--Zotlabs/Module/Mail.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php
index 53303816b..2fb89fed5 100644
--- a/Zotlabs/Module/Mail.php
+++ b/Zotlabs/Module/Mail.php
@@ -297,10 +297,8 @@ class Mail extends \Zotlabs\Web\Controller {
return $o;
}
- $last_message = private_messages_list(local_channel(), $mailbox, 0, 1);
+ $direct_mid = 0;
- $mid = ((argc() > 2) && (intval(argv(2)))) ? argv(2) : $last_message[0]['id'];
-
switch(argv(1)) {
case 'combined':
$mailbox = 'combined';
@@ -317,10 +315,17 @@ class Mail extends \Zotlabs\Web\Controller {
// notifications direct to mail/nn
if(intval(argv(1)))
- $mid = intval(argv(1));
+ $direct_mid = intval(argv(1));
break;
}
+
+ $last_message = private_messages_list(local_channel(), $mailbox, 0, 1);
+
+ $mid = ((argc() > 2) && (intval(argv(2)))) ? argv(2) : $last_message[0]['id'];
+
+ if($direct_mid)
+ $mid = $direct_mid;
$plaintext = true;