Skip to content

Commit

Permalink
Hide group member only instances from Discord presence
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsumi-sama committed Sep 19, 2024
1 parent 0c64595 commit 914e5a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Dotnet/AssetBundleCacher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ public void DownloadFile(string fileUrl, string hashUrl, int size)
#pragma warning disable SYSLIB0014 // Type or member is obsolete
client = new WebClient();
#pragma warning restore SYSLIB0014 // Type or member is obsolete
client.Headers.Add("user-agent", Program.Version);
if (WebApi.ProxySet)
client.Proxy = WebApi.Proxy;
client.Headers.Add("user-agent", Program.Version);
DownloadProgress = 0;
DownloadSize = size;
DownloadCanceled = false;
Expand Down
18 changes: 7 additions & 11 deletions Dotnet/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,15 @@ public static void DownloadInstallRedist()

private static string DownloadFile(string fileUrl)
{
HttpClientHandler handler = new HttpClientHandler();

if(WebApi.ProxySet)
{
handler.Proxy = WebApi.Proxy;
handler.UseProxy = true;
}

HttpClient client = new HttpClient(handler);
var httpClientHandler = new HttpClientHandler();
if (WebApi.ProxySet)
httpClientHandler.Proxy = WebApi.Proxy;

var httpClient = new HttpClient(httpClientHandler);

try
{
HttpResponseMessage response = client.GetAsync(fileUrl).Result;
HttpResponseMessage response = httpClient.GetAsync(fileUrl).Result;

if (response.IsSuccessStatusCode)
{
Expand Down Expand Up @@ -122,7 +118,7 @@ private static string DownloadFile(string fileUrl)
}
finally
{
client.Dispose();
httpClient.Dispose();
}
}

Expand Down
9 changes: 6 additions & 3 deletions html/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5237,7 +5237,9 @@ speechSynthesis.getVoices();

case 'instance-queue-left':
console.log('instance-queue-left', content);
$app.instanceQueueClear();
var instanceId = content.instanceLocation;
$app.removeQueuedInstance(instanceId);
// $app.instanceQueueClear();
break;

case 'content-refresh':
Expand Down Expand Up @@ -13762,10 +13764,11 @@ speechSynthesis.getVoices();
this.lastLocation$ = L;
}
var hidePrivate = false;
// (L.accessType === 'group' && !L.groupAccessType) || L.groupAccessType === 'member')
if (
this.discordHideInvite &&
(L.accessType === 'invite' || L.accessType === 'invite+')
(L.accessType === 'invite' ||
L.accessType === 'invite+' ||
L.groupAccessType === 'members')
) {
hidePrivate = true;
}
Expand Down

0 comments on commit 914e5a9

Please sign in to comment.