mirror of
https://github.com/friendica/friendica
synced 2025-04-26 23:10:11 +00:00
maintain backward compatibility with old PMs
This commit is contained in:
parent
c8d5274cee
commit
adbc84c48e
2 changed files with 20 additions and 10 deletions
|
@ -27,9 +27,27 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
|
|||
$hash = random_string();
|
||||
$uri = 'urn:X-dfrn:' . $a->get_baseurl() . ':' . local_user() . ':' . $hash ;
|
||||
|
||||
if(! strlen($replyto)) {
|
||||
$convid = 0;
|
||||
|
||||
// look for any existing conversation structure
|
||||
|
||||
if(strlen($replyto)) {
|
||||
$r = q("select convid from mail where uid = %d and uri = '%s' limit 1",
|
||||
intval(local_user()),
|
||||
dbesc($replyto)
|
||||
);
|
||||
if(count($r))
|
||||
$convid = $r[0]['convid'];
|
||||
}
|
||||
|
||||
if(! strlen($replyto))
|
||||
$replyto = $uri;
|
||||
|
||||
|
||||
if(! $convid) {
|
||||
|
||||
// create a new conversation
|
||||
|
||||
$conv_guid = get_guid();
|
||||
|
||||
$recip_host = substr($contact[0]['url'],strpos($contact[0]['url'],'://')+3);
|
||||
|
@ -52,14 +70,6 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
|
|||
if(count($r))
|
||||
$convid = $r[0]['id'];
|
||||
}
|
||||
else {
|
||||
$r = q("select convid from mail where uid = %d and uri = '%s' limit 1",
|
||||
intval(local_user()),
|
||||
dbesc($replyto)
|
||||
);
|
||||
if(count($r))
|
||||
$convid = $r[0]['convid'];
|
||||
}
|
||||
|
||||
if(! $convid) {
|
||||
logger('send message: conversation not found.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue