Merge pull request #10409 from Mailaender/fix-globalchat
Fixed all known crashes in GlobalChat
This commit is contained in:
@@ -224,10 +224,18 @@ namespace OpenRA.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnKick(object sender, KickEventArgs e)
|
void OnKick(object sender, KickEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Whom == client.Nickname)
|
||||||
{
|
{
|
||||||
Disconnect();
|
Disconnect();
|
||||||
connectionStatus = ChatConnectionStatus.Error;
|
connectionStatus = ChatConnectionStatus.Error;
|
||||||
AddNotification("Error: You were kicked from the chat by {0}".F(e.Who));
|
AddNotification("You were kicked from the chat by {0}. ({1})".F(e.Who, e.KickReason));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Users.Remove(e.Whom);
|
||||||
|
AddNotification("{0} was kicked from the chat by {1}. ({2})".F(e.Whom, e.Who, e.KickReason));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnJoin(object sender, JoinEventArgs e)
|
void OnJoin(object sender, JoinEventArgs e)
|
||||||
|
|||||||
@@ -379,6 +379,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
|
|
||||||
void BindingAddImpl(object item)
|
void BindingAddImpl(object item)
|
||||||
{
|
{
|
||||||
|
if (makeWidget == null)
|
||||||
|
return;
|
||||||
|
|
||||||
var widget = makeWidget(item);
|
var widget = makeWidget(item);
|
||||||
var scrollToBottom = autoScroll && ScrolledToBottom;
|
var scrollToBottom = autoScroll && ScrolledToBottom;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user