diff options
Diffstat (limited to 'include/import.php')
-rw-r--r-- | include/import.php | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/include/import.php b/include/import.php index 022440676..bf7f47c3e 100644 --- a/include/import.php +++ b/include/import.php @@ -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. * |