Added correct unicode representation to chat messages

This commit is contained in:
Manuel Cortez 2019-02-03 21:04:10 -06:00
parent 38b0eec741
commit 21895d307b
2 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@
* Added documents to the list of supported files when adding attachments to a wall post or private message. * 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. * 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)) * 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: * 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. * 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. * You can create or delete all buffers for groups by pressing the menu key or right mouse click in the "communities" buffer.

View File

@ -485,7 +485,7 @@ class Controller(object):
self.session.soundplayer.play("conversation_opened.ogg") self.session.soundplayer.play("conversation_opened.ogg")
return return
# If the chat already exists, let's create a dictionary wich will contains data of the received message. # 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. # 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. # ToDo: code improvements. We shouldn't need to request the same message again just for these attachments.
if len(message["attachments"]) != 0: if len(message["attachments"]) != 0: