mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 18:43:10 +08:00
Add ClientId for application messages published by the server.
This commit is contained in:
@@ -364,7 +364,13 @@ namespace MQTTnet.Server
|
||||
return null;
|
||||
}
|
||||
|
||||
var interceptorContext = new MqttApplicationMessageInterceptorContext(sender?.ClientId, applicationMessage);
|
||||
var senderClientId = sender?.ClientId;
|
||||
if (sender == null)
|
||||
{
|
||||
senderClientId = _options.ClientId;
|
||||
}
|
||||
|
||||
var interceptorContext = new MqttApplicationMessageInterceptorContext(senderClientId, applicationMessage);
|
||||
await interceptor.InterceptApplicationMessagePublishAsync(interceptorContext).ConfigureAwait(false);
|
||||
return interceptorContext;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user