Skip to content

Commit

Permalink
Fixed the Banhammer-related trollbox bug which could cause crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojatekok committed Oct 18, 2014
1 parent 851603b commit 9a9b64d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 2 additions & 4 deletions PoloniexApi.Net/General/EventArgs/TrollboxMessageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ namespace Jojatekok.PoloniexAPI
public class TrollboxMessageEventArgs : EventArgs
{
public string SenderName { get; private set; }
public uint SenderReputation { get; private set; }
public string MessageType { get; private set; }
public uint? SenderReputation { get; private set; }
public ulong MessageNumber { get; private set; }
public string MessageText { get; private set; }

internal TrollboxMessageEventArgs(string senderName, uint senderReputation, string messageType, ulong messageNumber, string messageText)
internal TrollboxMessageEventArgs(string senderName, uint? senderReputation, ulong messageNumber, string messageText)
{
SenderName = senderName;
SenderReputation = senderReputation;
MessageType = messageType;
MessageNumber = messageNumber;
MessageText = messageText;
}
Expand Down
5 changes: 2 additions & 3 deletions PoloniexApi.Net/LiveTools/Live.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ private void ProcessMessageTrollbox(ISerializedValue[] arguments)
{
if (OnTrollboxMessage == null) return;

var messageType = arguments[0].Deserialize<string>();
var messageNumber = arguments[1].Deserialize<ulong>();
var senderName = arguments[2].Deserialize<string>();
var messageText = HttpUtility.HtmlDecode(arguments[3].Deserialize<string>());
var senderReputation = arguments[4].Deserialize<uint>();
var senderReputation = arguments.Length >= 5 ? arguments[4].Deserialize<uint?>() : null;

OnTrollboxMessage(this, new TrollboxMessageEventArgs(senderName, senderReputation, messageType, messageNumber, messageText));
OnTrollboxMessage(this, new TrollboxMessageEventArgs(senderName, senderReputation, messageNumber, messageText));
}
}
}
4 changes: 2 additions & 2 deletions PoloniexApi.Net/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.1")]
[assembly: AssemblyFileVersion("1.1.1")]
[assembly: AssemblyVersion("1.1.2")]
[assembly: AssemblyFileVersion("1.1.2")]
[assembly: NeutralResourcesLanguageAttribute("en")]

0 comments on commit 9a9b64d

Please sign in to comment.