majn / telegram-purple

Adds support for Telegram to Pidgin, Adium, Finch and other Libpurple based messengers.
GNU General Public License v2.0
735 stars 82 forks source link

Correct history saving #362

Open vn971 opened 7 years ago

vn971 commented 7 years ago

Would it be possible for telegram-purple to save history in a pidgin-compatible way? Currently, if I send a text:

a
b
c

Pidgin will show it in the chat window as 3-line message, but will show it as 1-line message in the history.

OS=ArchLinux, telegram-purple-version=dev-1.4.0, pidginv-version=2.12.0 (libpurple 2.12.0) Note that I have "Show formatting on incoming messages" disabled by default; if that matters at all.

BenWiederhake commented 7 years ago

telegram-purple has absolutely no control over that, and there's nothing the libpurple API we could possibly use for that. Maybe look into your frontend's settings, i.e., Pidgin's "protocol format" setting (Buddy List window > Extras > Settings > "Protocollation" tab, select "HTML" in the "protocol format" combobox).

If that doesn't work, raise a bug against your frontend itself, e.g. Pidgin.

vn971 commented 7 years ago

@BenWiederhake wait, I object to the resolution. Jabber can happily save multi-line messages and they look fine in the history. Obviosly, there's nothing in purple that prevents that. How is telegram different to jabber(xmpp)?

BenWiederhake commented 7 years ago

Good question. @majn?

majn commented 6 years ago

The problem: Line-Breaks are stored as \n, not as
. A fix would be to exchange all line breaks with
before printing the message into chats.

The breaks probably should be replaced in tgp_msg_reply_display after purple_markup_escape_text was called