Open BafDyce opened 6 years ago
That code can be found in Log.cpp (https://github.com/mumble-voip/mumble/blob/master/src/mumble/Log.cpp#L429):
int messageSize = s.width() * s.height();
int allowedSize = 2048 * 2048;
if (messageSize > allowedSize) {
QString errorSizeMessage = tr("[[ Text object too large to display ]]");
It checks the potential rendered screen surface area in pixels of the message. The idea was limit display size as with html formatting even very short text can be made to take up pretty much arbitrary screen space. I'm not sure in what way this interacts with DPI / scaling configurations but I doubt they those were a considerations when this was introduced.
I assume the inconsistencies you are seeing are due to text rendering differences on the different plattforms, versions and/or systems you tested.
This also means you cannot really know how big your message can get before the client decides it is to big for it to render as that depends on client-side (system) configuration. If you want to be reasonably sure it is displayed cap it before it well before it gets to the limit on a normally configured system.
When sending very long text messages, there is some inconsistent behaviours by the official mumble clients. First some facts:
20480
characters (afaik the default value is5000
).20463
characters (20469
after serialization and a total packet length of20475
)13246
characters (13251
after serialization and a total packet length of13257
)The following behaviour is observed:
TextTooLong
messages (as it would be the case if a message was longer than the allowed length)1.3.0~2729~g2126495~snapshot
onLinux (Arch, 64-bit)
:[[ Text object too large to display ]]
1.3.0~2729~g2126495~snapshot
onWindows (8.1, 64-bit)
:1.2.19
onWindows (10, 64 bit)
:[[ Text object too large to display ]]
So, while the server accepts the messages and forwards it to the official clients, all of them handle them differently. We could not find any setting which would control this behavior, so we assumed that it's controlled by some hard-coded value in the source code. However, by reading/searching through the source code I could not find the source code in judge of this.
My primary questions now are: