diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-03-19 21:48:49 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-03-19 21:48:49 -0700 |
commit | b117db5327ee30aae7d2ec8e9172dca85e933848 (patch) | |
tree | 622375c2d4ac3be8b5ed8823daebc6d2c0c3afc4 /src/DotNetOpenAuth.Core/Messaging/Channel.cs | |
parent | 2eb59292e2a2f22866d95684606334845d8997e5 (diff) | |
download | DotNetOpenAuth-b117db5327ee30aae7d2ec8e9172dca85e933848.zip DotNetOpenAuth-b117db5327ee30aae7d2ec8e9172dca85e933848.tar.gz DotNetOpenAuth-b117db5327ee30aae7d2ec8e9172dca85e933848.tar.bz2 |
Fixes the rest of the build breaks!
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/Channel.cs')
-rw-r--r-- | src/DotNetOpenAuth.Core/Messaging/Channel.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/Channel.cs b/src/DotNetOpenAuth.Core/Messaging/Channel.cs index 62de162..b087538 100644 --- a/src/DotNetOpenAuth.Core/Messaging/Channel.cs +++ b/src/DotNetOpenAuth.Core/Messaging/Channel.cs @@ -669,6 +669,10 @@ namespace DotNetOpenAuth.Messaging { Requires.NotNull(request, "request"); Requires.That(request.Recipient != null, "request", MessagingStrings.DirectedMessageMissingRecipient); + if (this.OutgoingMessageFilter != null) { + this.OutgoingMessageFilter(request); + } + var webRequest = this.CreateHttpRequest(request); var directRequest = request as IHttpDirectRequest; if (directRequest != null) { @@ -975,6 +979,10 @@ namespace DotNetOpenAuth.Messaging { return dictionary; } + internal Action<IProtocolMessage> OutgoingMessageFilter { get; set; } + + internal Action<IProtocolMessage> IncomingMessageFilter { get; set; } + /// <summary> /// Prepares a message for transmit by applying signatures, nonces, etc. /// </summary> @@ -1024,6 +1032,10 @@ namespace DotNetOpenAuth.Messaging { this.EnsureValidMessageParts(message); message.EnsureValidMessage(); + if (this.OutgoingMessageFilter != null) { + this.OutgoingMessageFilter(message); + } + if (Logger.Channel.IsInfoEnabled) { var directedMessage = message as IDirectedProtocolMessage; string recipient = (directedMessage != null && directedMessage.Recipient != null) ? directedMessage.Recipient.AbsoluteUri : "<response>"; @@ -1223,6 +1235,10 @@ namespace DotNetOpenAuth.Messaging { // message deserializer did for us. It would be too late to do it here since // they might look initialized by the time we have an IProtocolMessage instance. message.EnsureValidMessage(); + + if (this.IncomingMessageFilter != null) { + this.IncomingMessageFilter(message); + } } /// <summary> |