Parse replies in comments. Start changes for #1
This commit is contained in:
parent
ee308fb5aa
commit
f079907a9e
@ -6,6 +6,7 @@
|
||||
* Added two more buffers: "Followers" and "I follow", located in the people buffer, under "friendship requests".
|
||||
* Added an experimental photo viewer. Will show options for see the next and previous photo if the current post contains multiple images.
|
||||
* Improved chats, now they should be more stable. Also you will be able to send the message by pressing enter in the text box. If you are trying to send the same message multiple times, you will be warned.
|
||||
* Added video management (my videos, video albums and video search). For playing videos, you will be redirected to a website in your browser.
|
||||
|
||||
## Changes in build 2016.07.08 (08/07/2016)
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import os
|
||||
import cStringIO
|
||||
import threading
|
||||
@ -104,11 +105,13 @@ class postController(object):
|
||||
from_ = get_user(i["from_id"], self.comments["profiles"])
|
||||
if i.has_key("reply_to_user"):
|
||||
extra_info = get_user(i["reply_to_user"], self.comments["profiles"])
|
||||
from_ = _(u"{0} Has replied to {1}").format(from_, extra_info)
|
||||
if len(i["text"]) > 140:
|
||||
text = i["text"][:141]
|
||||
from_ = _(u"{0} > {1}").format(from_, extra_info)
|
||||
# As we set the comment reply properly in the from_ field, let's remove the first username from here if it exists.
|
||||
fixed_text = re.sub("^\[id\d+\|\D+\], ", "", i["text"])
|
||||
if len(fixed_text) > 140:
|
||||
text = fixed_text[:141]
|
||||
else:
|
||||
text = i["text"]
|
||||
text = fixed_text
|
||||
original_date = arrow.get(i["date"])
|
||||
created_at = original_date.humanize(locale=languageHandler.getLanguage())
|
||||
likes = str(i["likes"]["count"])
|
||||
|
Loading…
Reference in New Issue
Block a user