Removed _userId references

This commit is contained in:
RogueException
2015-12-10 15:44:55 -04:00
parent 3c22ed519c
commit 910b4c4c3d
3 changed files with 5 additions and 6 deletions

View File

@@ -136,7 +136,7 @@ namespace Discord
channel = user.Global.PrivateChannel;
if (channel == null)
{
var response = await _api.CreatePMChannel(_userId.Value, user.Id).ConfigureAwait(false);
var response = await _api.CreatePMChannel(_privateUser.Id, user.Id).ConfigureAwait(false);
var recipient = _users.GetOrAdd(response.Recipient.Id, null);
recipient.Update(response.Recipient);
channel = _channels.GetOrAdd(response.Id, response.GuildId, response.Recipient.Id);

View File

@@ -195,13 +195,13 @@ namespace Discord
if (Config.UseMessageQueue)
{
var nonce = GenerateNonce();
msg = _messages.GetOrAdd(nonce, channel.Id, _userId.Value);
msg = _messages.GetOrAdd(nonce, channel.Id, _privateUser.Id);
var currentUser = msg.User;
msg.Update(new MessageInfo
{
Content = text,
Timestamp = DateTime.UtcNow,
Author = new UserReference { Avatar = currentUser.AvatarId, Discriminator = currentUser.Discriminator, Id = _userId.Value, Username = currentUser.Name },
Author = new UserReference { Avatar = currentUser.AvatarId, Discriminator = currentUser.Discriminator, Id = _privateUser.Id, Username = currentUser.Name },
ChannelId = channel.Id,
Nonce = IdConvert.ToString(nonce),
IsTextToSpeech = isTextToSpeech

View File

@@ -58,7 +58,6 @@ namespace Discord
private readonly object _cacheLock;
private Logger _logger, _restLogger, _cacheLogger;
private bool _sentInitialLog;
private long? _userId;
private UserStatus _status;
private int? _gameId;
private Task _runTask;
@@ -413,7 +412,7 @@ namespace Discord
await _webSocket.SignalDisconnect().ConfigureAwait(false);
_userId = null;
_privateUser = null;
_gateway = null;
_token = null;
@@ -664,7 +663,7 @@ namespace Discord
var data = e.Payload.ToObject<MessageCreateEvent>(_webSocket.Serializer);
Message msg = null;
bool isAuthor = data.Author.Id == _userId;
bool isAuthor = data.Author.Id == _privateUser.Id;
int nonce = 0;
if (data.Author.Id == _privateUser.Id && Config.UseMessageQueue)