mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
remove deprecated mail code
This commit is contained in:
@@ -1089,85 +1089,6 @@ function import_likes($channel, $likes) {
|
||||
}
|
||||
}
|
||||
|
||||
function import_conv($channel,$convs) {
|
||||
if($channel && $convs) {
|
||||
foreach($convs as $conv) {
|
||||
if($conv['deleted']) {
|
||||
q("delete from conv where guid = '%s' and uid = %d",
|
||||
dbesc($conv['guid']),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
unset($conv['id']);
|
||||
|
||||
$conv['uid'] = $channel['channel_id'];
|
||||
$conv['subject'] = str_rot47(base64url_encode($conv['subject']));
|
||||
|
||||
$r = q("select id from conv where guid = '%s' and uid = %d limit 1",
|
||||
dbesc($conv['guid']),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
if($r)
|
||||
continue;
|
||||
|
||||
create_table_from_array('conv',$conv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Import mails.
|
||||
*
|
||||
* @param array $channel
|
||||
* @param array $mails
|
||||
* @param boolean $sync (optional) default false
|
||||
*/
|
||||
function import_mail($channel, $mails, $sync = false) {
|
||||
if($channel && $mails) {
|
||||
foreach($mails as $mail) {
|
||||
if(array_key_exists('flags',$mail) && in_array('deleted',$mail['flags'])) {
|
||||
q("delete from mail where mid = '%s' and uid = %d",
|
||||
dbesc($mail['message_id']),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
continue;
|
||||
}
|
||||
if(array_key_exists('flags',$mail) && in_array('recalled',$mail['flags'])) {
|
||||
q("update mail set mail_recalled = 1 where mid = '%s' and uid = %d",
|
||||
dbesc($mail['message_id']),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
$m = get_mail_elements($mail);
|
||||
if(! $m)
|
||||
continue;
|
||||
|
||||
$m['account_id'] = $channel['channel_account_id'];
|
||||
$m['channel_id'] = $channel['channel_id'];
|
||||
|
||||
$mail_id = mail_store($m);
|
||||
if($sync && $mail_id) {
|
||||
Zotlabs\Daemon\Master::Summon(array('Notifier','single_mail',$mail_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Synchronise mails.
|
||||
*
|
||||
* @see import_mail()
|
||||
* @param array $channel
|
||||
* @param array $mails
|
||||
*/
|
||||
function sync_mail($channel, $mails) {
|
||||
import_mail($channel, $mails, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Synchronise files.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user