Skip to content

Commit d78f61b

Browse files
🔀 merge v3.15.0 pull request
2 parents 5892c05 + 1b22674 commit d78f61b

25 files changed

+547
-349
lines changed

.github/labels.yml renamed to .github/issues/labels.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
- name: a11y
2+
description: about accessibility
3+
color: fef2c0
4+
- name: await test repository
5+
description: waiting for a minimal test repository
6+
color: 5319e7
17
- name: bug
28
description: bug to fix
39
color: fbca04
@@ -9,7 +15,7 @@
915
color: 00209a
1016
- name: critical
1117
description: critical failure to fix as soon as possible
12-
color: d93f0b
18+
color: b60205
1319
- name: dependencies
1420
description: update/upgrade one or more dependency
1521
color: 0366d6
@@ -19,24 +25,30 @@
1925
- name: documentation
2026
description: regarding the project documentation
2127
color: 27d19b
28+
- name: duplicate
29+
description: a similar issue already exists
30+
color: ededed
2231
- name: feature
2332
description: feature request to implement
2433
color: 1d76db
2534
- name: help
2635
description: need help, any contribution are welcome
2736
color: 5319e7
37+
- name: source map
38+
description: about source mapping
39+
color: ebe4da
2840
- name: motion
29-
description: motion request
41+
description: about motion and animation
3042
color: 32deca
3143
- name: optimization
3244
description: optimization request
3345
color: 128a0c
3446
- name: post-it
3547
description: reminder or todo
3648
color: fcf49c
37-
- name: platform
49+
- name: environment
3850
description: regarding the environment or target platform
3951
color: f1f1f1
4052
- name: wontfix
4153
description: negligible issue or that will never be fixed
42-
color: 444444
54+
color: 000000

.github/workflows/ci.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Github workflow for Continuous Integration
22

3-
name: CI
3+
name: 🤖 continuous integration
44

55
on:
66
push:
@@ -13,7 +13,7 @@ on:
1313
- dev
1414

1515
jobs:
16-
build:
16+
build-debug:
1717
runs-on: windows-latest
1818
defaults:
1919
run:
@@ -35,11 +35,48 @@ jobs:
3535
run: |
3636
msbuild.exe InboxNotifier.sln /p:configuration="Debug" /p:platform="Any CPU" /m
3737
38+
build-x86:
39+
runs-on: windows-latest
40+
needs: build-debug
41+
defaults:
42+
run:
43+
working-directory: code
44+
steps:
45+
- name: Checkout the repository
46+
uses: actions/checkout@v4
47+
48+
- name: Setup MSBuild
49+
uses: microsoft/setup-msbuild@v2
50+
51+
- name: Setup NuGet
52+
uses: NuGet/setup-nuget@v2
53+
54+
- name: Restore NuGet packages
55+
run: nuget restore InboxNotifier.sln
56+
3857
- name: Build solution — Release 32 bits (x86)
3958
run: |
4059
msbuild.exe InboxNotifier.sln /p:configuration="Release x86" /p:platform="Any CPU" /m
4160
61+
build-x64:
62+
runs-on: windows-latest
63+
needs: build-x86
64+
defaults:
65+
run:
66+
working-directory: code
67+
steps:
68+
- name: Checkout the repository
69+
uses: actions/checkout@v4
70+
71+
- name: Setup MSBuild
72+
uses: microsoft/setup-msbuild@v2
73+
74+
- name: Setup NuGet
75+
uses: NuGet/setup-nuget@v2
76+
77+
- name: Restore NuGet packages
78+
run: nuget restore InboxNotifier.sln
79+
4280
- name: Build solution — Release 64 bits (x64)
4381
run: |
4482
msbuild.exe InboxNotifier.sln /p:configuration="Release x64" /p:platform="Any CPU" /m
45-

.github/workflows/sync-labels.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
# Github workflow to automatically sync labels in a declarative way
22
# https://github.com/micnncim/action-label-syncer
33

4-
name: Sync labels
4+
name: 🏷️ synchronize labels
55

66
on:
77
push:
88
branches:
99
- main
1010
paths:
11-
- '.github/labels.yml'
11+
- .github/issues/labels.yml
12+
13+
permissions:
14+
contents: write
15+
issues: write
1216

1317
jobs:
1418
labels:
1519
runs-on: ubuntu-latest
1620
steps:
1721
- uses: actions/checkout@v4
1822
- uses: micnncim/action-label-syncer@v1
23+
with:
24+
manifest: .github/issues/labels.yml
1925
env:
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
GITHUB_TOKEN: ${{ github.token }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Note that this version of the .NET Framework **evolve in time**: the application
4545
#### Setup installer
4646
The setup installer contains both `32 bits (x86)` and `64 bits (x64)` versions: this is the better way to install Windows application and allow you to **cleanly install/uninstall** the application with ease.
4747

48-
* :package: [Inbox Notifier 3.11.0](https://github.com/xavierfoucrier/inbox-notifier/releases/download/v3.11.0/Inbox.Notifier.3.11.0.exe)
48+
* :package: [Inbox Notifier 3.15.0](https://github.com/xavierfoucrier/inbox-notifier/releases/download/v3.15.0/Inbox.Notifier.3.15.0.exe)
4949

5050
> Note that you will need **administrator rights** to properly complete the installation.
5151

code/App.config

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@
8989
</userSettings>
9090
<runtime>
9191
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
92-
<dependentAssembly>
93-
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral"/>
94-
<bindingRedirect oldVersion="0.0.0.0-1.2.15.0" newVersion="1.2.15.0"/>
95-
</dependentAssembly>
9692
<dependentAssembly>
9793
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
9894
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="12.0.0.0"/>

code/Computer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void BindSessionSwitch() {
8888
}
8989

9090
// synchronize the inbox and renew the token
91-
await UI.GmailService.Inbox.Sync(true, true);
91+
await UI.GmailService.Inbox.Sync(token: true);
9292

9393
// enable the timer properly
9494
UI.timer.Enabled = true;

code/Core.cs

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ static Core() {
2121
// initialize the application version number, based on scheme Semantic Versioning - https://semver.org
2222
string[] ProductVersion = Application.ProductVersion.Split('.');
2323

24-
string VersionMajor = ProductVersion[0];
25-
string VersionMinor = ProductVersion[1];
26-
string VersionPatch = ProductVersion[2];
24+
MajorVersion = int.Parse(ProductVersion[0]);
25+
MinorVersion = int.Parse(ProductVersion[1]);
26+
PatchVersion = int.Parse(ProductVersion[2]);
2727

28-
Version = $"v{VersionMajor}.{VersionMinor}.{VersionPatch}";
28+
Version = $"v{MajorVersion}.{MinorVersion}.{PatchVersion}";
2929
}
3030

3131
/// <summary>
@@ -34,13 +34,15 @@ static Core() {
3434
public static void RestartApplication() {
3535

3636
// start a new process
37-
Process.Start(new ProcessStartInfo("cmd.exe", $"/C ping 127.0.0.1 -n 2 && \"{Application.ExecutablePath}\"") {
37+
Process.Start(new ProcessStartInfo {
38+
FileName = Application.ExecutablePath,
39+
UseShellExecute = true,
3840
WindowStyle = ProcessWindowStyle.Hidden,
3941
CreateNoWindow = true
4042
});
4143

42-
// exit the application
43-
Application.Exit();
44+
// exit the environment
45+
Environment.Exit(0);
4446
}
4547

4648
/// <summary>
@@ -71,6 +73,27 @@ public static string Version {
7173
get;
7274
} = "";
7375

76+
/// <summary>
77+
/// Major application version number
78+
/// </summary>
79+
public static int MajorVersion {
80+
get;
81+
} = 0;
82+
83+
/// <summary>
84+
/// Minor application version number
85+
/// </summary>
86+
public static int MinorVersion {
87+
get;
88+
} = 0;
89+
90+
/// <summary>
91+
/// Patch application version number
92+
/// </summary>
93+
public static int PatchVersion {
94+
get;
95+
} = 0;
96+
7497
#endregion
7598
}
7699
}

code/Gmail.cs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,13 @@ public async Task Authentication() {
123123
// enable the main timer
124124
UI.timer.Enabled = true;
125125

126-
// synchronize the user mailbox, after checking for update depending on the user settings, or by default after the asynchronous authentication
126+
// check for update depending on the user settings
127127
if (Settings.Default.UpdateService && Update.IsPeriodSetToStartup()) {
128128
await UI.UpdateService.Check(!Settings.Default.UpdateDownload, true);
129-
} else {
130-
await Inbox.Sync();
131129
}
130+
131+
// synchronize the user mailbox
132+
await Inbox.Sync();
132133
}
133134

134135
/// <summary>
@@ -139,7 +140,7 @@ public async Task<bool> RefreshToken() {
139140

140141
// refresh the token and update the token delivery date and time on the interface
141142
try {
142-
if (Credential.Token.IsExpired(Credential.Flow.Clock)) {
143+
if (Credential.Token.IsStale) {
143144
if (await Credential.RefreshTokenAsync(new CancellationToken())) {
144145
UI.labelTokenDelivery.Text = Credential.Token.IssuedUtc.ToLocalTime().ToString();
145146
}
@@ -188,21 +189,22 @@ private static async Task<UserCredential> AuthorizationBroker() {
188189
using (FileStream stream = new FileStream($"{Path.GetDirectoryName(Application.ExecutablePath)}/client_secret.json", FileMode.Open, FileAccess.Read)) {
189190

190191
// define a cancellation token source
191-
CancellationTokenSource cancellation = new CancellationTokenSource();
192-
cancellation.CancelAfter(TimeSpan.FromSeconds(Settings.Default.OAUTH_TIMEOUT));
193-
194-
// wait for the user validation, only if the user has not already authorized the application
195-
UserCredential credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
196-
GoogleClientSecrets.FromStream(stream).Secrets,
197-
new string[] { GmailService.Scope.GmailModify },
198-
"user",
199-
cancellation.Token,
200-
new FileDataStore(Core.ApplicationDataFolder, true),
201-
new LocalServerCodeReceiver(Resources.oauth_message)
202-
);
203-
204-
// return the user credential
205-
return credential;
192+
using (CancellationTokenSource cancellation = new CancellationTokenSource()) {
193+
cancellation.CancelAfter(TimeSpan.FromSeconds(Settings.Default.OAUTH_TIMEOUT));
194+
195+
// wait for the user validation, only if the user has not already authorized the application
196+
UserCredential credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
197+
GoogleClientSecrets.FromStream(stream).Secrets,
198+
new string[] { GmailService.Scope.GmailModify },
199+
"user",
200+
cancellation.Token,
201+
new FileDataStore(Core.ApplicationDataFolder, true),
202+
new LocalServerCodeReceiver(Resources.oauth_message)
203+
);
204+
205+
// return the user credential
206+
return credential;
207+
}
206208
}
207209
}
208210

0 commit comments

Comments
 (0)