From d6a62713a2d85d4b07aa0492736ed3353ff0f108 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Thu, 28 Jan 2021 16:18:33 +0200 Subject: [PATCH] Encode sender's username in direct messages --- source/dnetd/dconnection.d | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/dnetd/dconnection.d b/source/dnetd/dconnection.d index 50ce486..0ef681c 100644 --- a/source/dnetd/dconnection.d +++ b/source/dnetd/dconnection.d @@ -923,12 +923,18 @@ public class DConnection : Thread /* Set to user message (direct message, sub-sub-type) */ protocolData ~= [1]; - /* Encode the sender's length */ + /* Encode the recipients's length */ protocolData ~= [cast(byte)username.length]; /* Encode the username */ protocolData ~= cast(byte[])username; + /* Encode the sender's's length */ + protocolData ~= [cast(byte)this.username.length]; + + /* Encode the sender */ + protocolData ~= cast(byte[])this.username; + /* Encode the message */ protocolData ~= cast(byte[])message;