mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
feat: refine messenger factory to prevent conflicting state shapes for IDialerCallStatus and ICodecCallControls
This commit is contained in:
parent
d771320fff
commit
f3f7755735
2 changed files with 7 additions and 2 deletions
|
|
@ -32,7 +32,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void RegisterActions()
|
protected override void RegisterActions()
|
||||||
|
|
||||||
{
|
{
|
||||||
base.RegisterActions();
|
base.RegisterActions();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,13 @@ namespace PepperDash.Essentials
|
||||||
new MessengerFactoryEntry(
|
new MessengerFactoryEntry(
|
||||||
typeof(IHasDialer),
|
typeof(IHasDialer),
|
||||||
(d, mp, ck) => new IHasDialerMessenger(
|
(d, mp, ck) => new IHasDialerMessenger(
|
||||||
$"{d.Key}-dialer-{ck}", mp, d)
|
$"{d.Key}-dialer-{ck}", mp, d),
|
||||||
|
// IDialerCallStatus and ICodecCallControls both extend IHasDialer and each already
|
||||||
|
// provide their own richer messenger (posting a "calls" array) subscribed to the same
|
||||||
|
// CallStatusChange event and the same "/device/{key}" message path. Without this
|
||||||
|
// exclusion, a device implementing either interface would get both messengers posting
|
||||||
|
// conflicting state shapes ("callItem" vs "calls") to the same clients.
|
||||||
|
predicate: d => d is IHasDialer && !(d is IDialerCallStatus) && !(d is ICodecCallControls)
|
||||||
),
|
),
|
||||||
new MessengerFactoryEntry(
|
new MessengerFactoryEntry(
|
||||||
typeof(ICodecCallControls),
|
typeof(ICodecCallControls),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue