add "user/invites/sent" and "user/invites/received" requests
This commit is contained in:
parent
33833c60ef
commit
93fd8312da
4 changed files with 49 additions and 11 deletions
|
|
@ -37,16 +37,14 @@ public class Requests
|
|||
|
||||
try
|
||||
{
|
||||
string inviteFile = ACCOUNTS_DATA_DIR + $"/{id2}/dminvites/recv/{id};{DOMAIN}";
|
||||
string inviteFile = ACCOUNTS_DATA_DIR + $"/{id2}/dminvites/recv/{id}";
|
||||
if (Fs.Exists(inviteFile))
|
||||
{
|
||||
return "info:user.already.invited";
|
||||
}
|
||||
|
||||
await Fs.WriteFile(inviteFile, Encoding.UTF8.GetBytes("0"));
|
||||
|
||||
//im not saving this like ts is litterally local scenario
|
||||
//await Fs.WriteFile(inviteSentFile, []); //we should also save that this user invited someone, because this will act as dm accept verification while federating
|
||||
await Fs.WriteFile(ACCOUNTS_DATA_DIR + $"/{id}/dminvites/sent/{id2}", []); //we should also save that this user invited someone, because listing sent invites is cool
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
@ -81,14 +79,13 @@ public class Requests
|
|||
|
||||
if (isUserLocal)
|
||||
{
|
||||
/*
|
||||
string inviteSentFile = ACCOUNTS_DATA_DIR + $"/{id2}/dminvites/sent/{id};{DOMAIN}";
|
||||
|
||||
string inviteSentFile = ACCOUNTS_DATA_DIR + $"/{id2}/dminvites/sent/{id}";
|
||||
if (!Fs.Exists(inviteSentFile))
|
||||
{
|
||||
return "You can't create a DM without an invitation";
|
||||
return "error:cant.create.dm.without.invitation";
|
||||
}
|
||||
Fs.DeleteFile(inviteSentFile);
|
||||
*/ // local scenario, there is no need to check sent
|
||||
}
|
||||
else //check sent on federated server
|
||||
{
|
||||
|
|
@ -98,7 +95,7 @@ public class Requests
|
|||
}
|
||||
}
|
||||
|
||||
string inviteFile = ACCOUNTS_DATA_DIR + $"/{id}/dminvites/recv/{id2};{domain}";
|
||||
string inviteFile = $"{ACCOUNTS_DATA_DIR}/{id}/dminvites/recv/{id2}" + (isUserLocal ? "" : $";{domain}");
|
||||
if (Fs.Exists(inviteFile))
|
||||
{
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue