Skip to content

Commit f9d0f1a

Browse files
committed
Fixed Share Tray and authentication
1 parent b29ce36 commit f9d0f1a

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/Client.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class Client : INotifyPropertyChanged, IDisposable
7070
public event EventHandler<ErrorReceivedEventArgs>? ErrorReceived;
7171

7272
private readonly string teamsProcessName;
73-
private int requestId;
73+
private int requestId = 1;
7474

7575
public Client(bool autoConnect = false, string manufacturer = "Ro.", string device = "TeamsApiClient", string app = "TeamsApiClient", string appVersion = "1.0.0", string? token = null, CancellationToken cancellationToken = default)
7676
{
@@ -87,7 +87,6 @@ public Client(bool autoConnect = false, string manufacturer = "Ro.", string devi
8787
} else {
8888
teamsProcessName = "ms-teams";
8989
}
90-
requestId = 1;
9190

9291
if (autoConnect)
9392
_ = Connect(true, cancellationToken);
@@ -205,6 +204,7 @@ private async void Receive(CancellationToken cancellationToken = default)
205204
{
206205
clientInfo.Token = message.TokenRefresh;
207206
TokenReceived?.Invoke(this, new TokenReceivedEventArgs(message.TokenRefresh));
207+
await SendCommand(MeetingAction.QueryMeetingState, null, cancellationToken);
208208
}
209209

210210
if (message.MeetingUpdate is null || message.MeetingUpdate.MeetingState is null)
@@ -376,10 +376,10 @@ public async Task Connect(bool waitForTeams = true, CancellationToken cancellati
376376

377377
Connected?.Invoke(this, System.EventArgs.Empty);
378378
Receive(cancellationToken);
379-
if (string.IsNullOrWhiteSpace(clientInfo.Token)) {
379+
if (string.IsNullOrWhiteSpace(clientInfo.Token))
380380
await SendCommand(MeetingAction.Pair, null, cancellationToken);
381-
}
382-
await SendCommand(MeetingAction.QueryMeetingState, null, cancellationToken);
381+
else
382+
await SendCommand(MeetingAction.QueryMeetingState, null, cancellationToken);
383383
}
384384
finally
385385
{

src/ClientMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ internal enum ClientMessageParameterType
9393

9494
[JsonStringEnumMemberName("chat")]
9595
ToggleUiChat = 0b0000_1001_0000_0001,
96-
[JsonStringEnumMemberName("sharing-tray")]
96+
[JsonStringEnumMemberName("share-tray")]
9797
ToggleUiSharing = 0b0000_1001_0000_0010,
9898
}

src/Ro.Teams.LocalApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageId>$(AssemblyName)</PackageId>
1818
<Description>API Client for the client side Teams API</Description>
1919
<PackageProjectUrl>https://github.com/MrRoundRobin/TeamsLocalApi</PackageProjectUrl>
20-
<AssemblyVersion>1.0.0.0</AssemblyVersion>
20+
<AssemblyVersion>1.0.1.0</AssemblyVersion>
2121
<FileVersion>$(AssemblyVersion)</FileVersion>
2222
<Version>$(AssemblyVersion)</Version>
2323
<PackageLicenseFile>LICENSE</PackageLicenseFile>

0 commit comments

Comments
 (0)