From 21895d307bf35c16b21815fc28430918dadf0988 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Sun, 3 Feb 2019 21:04:10 -0600 Subject: [PATCH] Added correct unicode representation to chat messages --- changelog.md | 1 + src/controller/mainController.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 6705880..a98ad52 100644 --- a/changelog.md +++ b/changelog.md @@ -24,6 +24,7 @@ * Added documents to the list of supported files when adding attachments to a wall post or private message. * It is possible to enable or disable proxy from the preferences dialog. The application must be restarted for this change to take effect. * Fixed an error that was making Socializer unable to display the changelog properly, when opened from the help menu. ([#21](https://code.manuelcortez.net/manuelcortez/socializer/issues/21)) +* When receiving chat messages and in some other situations, socializer will display all characters properly. Before, usernames were rendered using the internal code VK uses for them, and some unicode characters were displaying their HTML representation. * Added improvements to groups: * It is possible to load topics, audios and videos for a group. In order to do so, you need to go to the group buffer and press the menu key, or right mouse click, in the tree item representing the group. New buffers will be created inside the current group's buffer. * You can create or delete all buffers for groups by pressing the menu key or right mouse click in the "communities" buffer. diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 01febfb..270b64f 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -485,7 +485,7 @@ class Controller(object): self.session.soundplayer.play("conversation_opened.ogg") return # If the chat already exists, let's create a dictionary wich will contains data of the received message. - message.update(id=obj.message_id, user_id=uid, date=obj.timestamp, body=obj.text, attachments=obj.attachments) + message.update(id=obj.message_id, user_id=uid, date=obj.timestamp, body=utils.clean_text(obj.text), attachments=obj.attachments) # if attachments is true, let's request for the full message with attachments formatted in a better way. # ToDo: code improvements. We shouldn't need to request the same message again just for these attachments. if len(message["attachments"]) != 0: