Browse Source

Minor comment edits

tags/docs-0.9
RogueException 9 years ago
parent
commit
255e012fe8
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/Discord.Net/MessageQueue.cs

+ 5
- 2
src/Discord.Net/MessageQueue.cs View File

@@ -73,8 +73,11 @@ namespace Discord.Net
internal void QueueEdit(Message msg, string text) internal void QueueEdit(Message msg, string text)
{ {
string msgText = msg.RawText; string msgText = msg.RawText;
if (msg.State == MessageState.Queued && _pendingSendsByNonce.TryUpdate(msg.Nonce, msgText, text))
if (msg.State == MessageState.Queued && _pendingSendsByNonce.TryUpdate(msg.Nonce, msgText, text))
{
//Successfully edited the message before it was sent.
return; return;
}
IncrementCount(); IncrementCount();
_pendingEdits.Enqueue(new MessageEdit(msg, text)); _pendingEdits.Enqueue(new MessageEdit(msg, text));
} }
@@ -83,7 +86,7 @@ namespace Discord.Net
string ignored; string ignored;
if (msg.State == MessageState.Queued && _pendingSendsByNonce.TryRemove(msg.Nonce, out ignored)) if (msg.State == MessageState.Queued && _pendingSendsByNonce.TryRemove(msg.Nonce, out ignored))
{ {
//Successfully stopped the message from being sent in the first place
//Successfully stopped the message from being sent
msg.State = MessageState.Aborted; msg.State = MessageState.Aborted;
return; return;
} }


Loading…
Cancel
Save