Files
harbour-grumpydove/engine/make_remote.adb
T
Carlo Baratto 9ed2bd614e Cartelle sul server: IMAP CREATE accodato (0.22.0)
Il motore aveva I_Create ma nessuno lo chiamava: Make_Folder crea solo sotto
Local (Can_Hold=1). Aggiunte tre patch (Note_Make in Mail_Pending, ramo mkdir
nel Flush) e l'unita' Make_Remote che esporta gd_make_remote. L'interfaccia ha
'Nuova cartella nell'account': la cartella nasce al controllo successivo.
2026-11-17 16:08:40 +01:00

34 lines
966 B
Ada

with Ada.Exceptions;
with Mail_Folders;
with Mail_Log;
with Mail_Pending;
package body Make_Remote is
function Make (Folder : int; Name : System.Address; Length : int) return int is
Path : constant String := Mail_Folders.Path_Of (Folder);
Text : String (1 .. Natural (Length)) with Import, Address => Name;
begin
-- Senza nome non c'è niente da creare; senza percorso la cartella non
-- esiste (indice vecchio, di un albero ricaricato).
if Length <= 0 or else Path = "" then
return -1;
end if;
-- Solo le cartelle di un account: sotto Local ci pensa Make_Folder.
if Mail_Folders.Can_Hold (Folder) /= 2 then
return -1;
end if;
Mail_Pending.Note_Make (Path, Text);
return 1;
exception
when Error : others =>
Mail_Log.Write
("ERR make remote: " & Ada.Exceptions.Exception_Message (Error));
return -1;
end Make;
end Make_Remote;