summaryrefslogtreecommitdiff
path: root/src/jwebmail/model
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2024-11-16 23:27:12 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2024-11-16 23:27:12 +0100
commitf123729ed492f70de3db35c042874e5750bbea72 (patch)
tree6f303cd679992c4812b6ab6dae0fb4b950b68177 /src/jwebmail/model
parent84d7234b661a161e198206bba45cbe077c9da33e (diff)
properly implement move and remove
added add_folder method to jwebmail api
Diffstat (limited to 'src/jwebmail/model')
-rw-r--r--src/jwebmail/model/jwebmail.proto9
-rw-r--r--src/jwebmail/model/read_mails.py7
2 files changed, 16 insertions, 0 deletions
diff --git a/src/jwebmail/model/jwebmail.proto b/src/jwebmail/model/jwebmail.proto
index bf1454a..e4cba3b 100644
--- a/src/jwebmail/model/jwebmail.proto
+++ b/src/jwebmail/model/jwebmail.proto
@@ -144,6 +144,14 @@ message RemoveReq {
message RemoveResp {
}
+message AddFolderReq {
+ string name = 1;
+}
+
+message AddFolderResp {
+ int32 status = 1;
+}
+
service MailService {
rpc List(ListReq) returns (ListResp);
rpc Stats(StatsReq) returns (StatsResp);
@@ -153,4 +161,5 @@ service MailService {
rpc Folders(FoldersReq) returns (FoldersResp);
rpc Move(MoveReq) returns (MoveResp);
rpc Remove(RemoveReq) returns (RemoveResp);
+ rpc AddFolder(AddFolderReq) returns (AddFolderResp);
}
diff --git a/src/jwebmail/model/read_mails.py b/src/jwebmail/model/read_mails.py
index 769589f..633c358 100644
--- a/src/jwebmail/model/read_mails.py
+++ b/src/jwebmail/model/read_mails.py
@@ -114,6 +114,13 @@ class QMailAuthuser:
r.ParseFromString(resp)
return True
+ def add_folder(self, name):
+ req = pb2.AddFolderReq(name=name)
+ resp = self.build_and_run("add_folder", req.SerializeToString())
+ r = pb2.AddFolderResp()
+ r.ParseFromString(resp)
+ return r.status
+
@staticmethod
def _address(addr):
if not addr: