vermule / gtalksms

Automatically exported from code.google.com/p/gtalksms
0 stars 0 forks source link

Message Formating improvement #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
So as my jabber client I'm using Psi.
When formatting a message like *this* or _that_ Psi only highlights it in the 
right way if there are no spaces in between.

So sadly the way gTalkSMS formats the "sms"-command-output Psi doesn't 
highlight it.

My suggestion would be to replace spaces by underscores and for better overview 
empty lines after each message would be nice.

"_07.02.2011 21:55:55 - Thomas_"
"_07.02.2011_21:55:55_-_Thomas_"

Psi likes it like that ;)

Original issue reported on code.google.com by ThDietri...@gmail.com on 7 Feb 2011 at 9:39

GoogleCodeExporter commented 9 years ago
I just realized, there is another problem with Psi. If I receive a message, 
gTalkSMS says (German):

*SMS von Thomas:* Hallo!

First of all like explained above sadly this is not *bold* formatted and even 
worse:
The ":*" is translated to a Kissing-Smiley.

I think these problems will occur in some other clients as well.

So maybe the best solution is to replace all spaces with underscores and 
instead of the ":" you could start a new line, looks better i think.

My best ;)

Original comment by ThDietri...@gmail.com on 8 Feb 2011 at 12:27

GoogleCodeExporter commented 9 years ago
We are aware of the problem. The formatting with * and _ is only a workaround. 
If you really want nice formatting: gtalksms adds a xhtml body to the xmpp 
message. I do not often use psi (using gajim instead), but I think that psi 
should be able to show xhtml messages right.

Original comment by fschm...@gmail.com on 8 Feb 2011 at 2:17

GoogleCodeExporter commented 9 years ago
There are many clients which do not support xhtml messages. This goes for the 
two I tested: Psi and Miranda.
However, a way better way, even as workaround, is using BBcode. I now use 
gTalkSMS like this and am happy with it.

XmppMsg.java:108

public String generateFmtTxt() {
    return _message.toString()
        .replaceAll(FontBegin, "")
        .replaceAll(BoldBegin, " [b]")
        .replaceAll(BoldEnd, "[/b] ")
        .replaceAll(ItalicBegin, " [u]")
        .replaceAll(ItalicEnd, "[/u] ");
}

Original comment by ThDietri...@gmail.com on 10 Feb 2011 at 2:09