Skip to content

Commit 04b1868

Browse files
committed
Fix topic differences
1 parent 3ff97e1 commit 04b1868

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Atlasd/Battlenet/Channel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,8 @@ public bool Resync()
684684
}
685685

686686
// Channel topic:
687-
var topic = RenderTopic(user);
688-
foreach (var line in topic.Split("\n"))
687+
string[] topic = RenderTopic(user).Replace("\r\n", "\n").Replace("\r", "\n").Split("\n");
688+
foreach (var line in topic)
689689
{
690690
args["chatEvent"] = new ChatEvent(ChatEvent.EventIds.EID_INFO, ActiveFlags, 0, Name, line);
691691
msg.Invoke(new MessageContext(user.Client, Protocols.MessageDirection.ServerToClient, args));
@@ -740,8 +740,8 @@ public void SetTopic(string newTopic)
740740
{
741741
foreach (var user in Users)
742742
{
743-
var lines = RenderTopic(user).Split(Battlenet.Common.NewLine);
744-
foreach (var line in lines) new ChatEvent(ChatEvent.EventIds.EID_INFO, ActiveFlags, 0, Name, line).WriteTo(user.Client);
743+
string[] topic = RenderTopic(user).Replace("\r\n", "\n").Replace("\r", "\n").Split("\n");
744+
foreach (var line in topic) new ChatEvent(ChatEvent.EventIds.EID_INFO, ActiveFlags, 0, Name, line).WriteTo(user.Client);
745745
}
746746
}
747747
}

0 commit comments

Comments
 (0)