giorgi-o / CrossPlatformPlaying

BetterDiscord plugin that lets you see what your friends are playing even if they turned off game activity
59 stars 5 forks source link

Why isn't a simple check for a matching number of opening and closing "<>" & tags enough to detect chunked messages sent by riot's xmpp server? #2

Closed M-U-X closed 2 years ago

M-U-X commented 2 years ago

Why isn't a simple check for a matching number of opening and closing "<>" then checking if the tags "openning closing" match, enough to detect chunked messages sent by riot's xmpp server, am I missing something regarding xml or anything else, if it's because it would fail if someone sent a message containing those elements, they are encoded as "<" & so on?

giorgi-o commented 2 years ago

Take this example message:

<tag1><tag2><tag3>...data...</tag3></tag2></tag1>

Now say Riot decides to split it in the middle of the data, there would be two messages:

<tag1><tag2><tag3>...data...
...data...</tag3></tag2></tag1>

Note the first tag has the same amount of < and >.

Even checking for an even number of tags doesn't work when you take into consideration self-closing <tags />.