Skip to content

Commit fc643ad

Browse files
authored
Merge pull request #38 from nextcloud/fix/availability-checks
Fix: app availability checks
2 parents 113afba + c94a6d1 commit fc643ad

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ex_app/lib/all_tools/context_chat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ def get_category_name():
3535
return "Context chat"
3636

3737
def is_available(nc: Nextcloud):
38-
return 'context_chat' in nc.apps.get_list()
38+
tasktypes = nc.ocs('GET', '/ocs/v2.php/taskprocessing/tasktypes')['types'].keys()
39+
return 'context_chat:context_chat' in tasktypes

ex_app/lib/all_tools/mail.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,8 @@ def get_category_name():
6767
return "Mail"
6868

6969
def is_available(nc: Nextcloud):
70-
return 'mail' in nc.apps.get_list()
70+
try:
71+
res = nc.ocs('GET', '/ocs/v2.php/apps/mail/account/list')
72+
except:
73+
return False
74+
return True

0 commit comments

Comments
 (0)