Newlines don't seem to work

Bug #1261890 reported by Kai Mast
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Friends
Invalid
Undecided
Unassigned
friends-app
New
Undecided
Kai Mast
friends-app (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I just noticed this with a facebook post. The newlines seem to be ignored by friends.

Maybe we have to convert "\n" to "<br/>" ?

Related branches

Revision history for this message
Robert Bruce Park (robru) wrote :

Ignored how? Ignoring the ones you type when you post a new message? Ignoring the ones other people have in their messages? Screenshot please.

Changed in friends:
status: New → Incomplete
Revision history for this message
Kai Mast (kai-mast) wrote :

I discovered in a post of another person. See the screenshot.

Revision history for this message
Robert Bruce Park (robru) wrote :

Please use debug_slave.py to find the raw value in the model... eg:

bzr branch lp:friends
cd friends
./tools/debug_slave.py

it will spit out a bunch of messages like this:

protocol : facebook
account_id : 2
message_id : 5826871351...
stream : reply_to/5152326
sender : Bob Bobbington
sender_id : 6471
sender_nick : Bob Bobbington
from_me : False
timestamp : 2013-12-13T04:36:44Z
message : Blah blah,

Second paragraph down here.
icon_uri : https://graph.facebook.com/647/picture?width=840&height=840
url : https://www.facebook.com/647/posts/39
likes : 0
liked : False
link_picture:
link_name :
link_url :
link_desc :
link_caption:
link_icon :
location :
latitude : 0.0
longitude : 0.0
ROWS: 321

Search through the output for the problematic message, and let me know if it all apears on one line there or not. If it has newlines, then the bug is in friends-app message display; if it doesn't then the bug is in friends message retrieval.

Revision history for this message
Kai Mast (kai-mast) wrote :

Grep was my friend ;)

"sender : Heike Betzold
sender_id : 100001612402336
sender_nick : Heike Betzold
from_me : False
timestamp : 2013-12-17T19:25:23Z
message : ladies, ladies
Uns gehört die welt!
ladies, ladies
Wie es uns gefällt!
:D"

Seems to be a bug in friends-app. I am pretty sure that QML handles "\n" properly but I will check the documentation.

Revision history for this message
Kai Mast (kai-mast) wrote :

I also noticed that I cannot insert newlines in friends-app. Pressing shift+return or just return both submit the message :/

Revision history for this message
Kai Mast (kai-mast) wrote :

I think I found the problem.

StatusUpdateContent.qml uses StyledText format, which accepts HTML syntax. I think in this case one has to convert \n to <br\>.

Changed in friends:
status: Incomplete → Invalid
Changed in friends-app (Ubuntu):
status: New → Triaged
Kai Mast (kai-mast)
Changed in friends-app:
assignee: nobody → Kai Mast (kai-mast)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package friends-app - 0.92.0+14.04.20140217-0ubuntu1

---------------
friends-app (0.92.0+14.04.20140217-0ubuntu1) trusty; urgency=low

  [ Kai Mast ]
  * Fix display of newlines. (LP: #1261890)

  [ Scott Sweeny ]
  * Remove iconSource definition from accountDelegate According to [1]
    if both iconName and iconSource are defined iconName is ignored.
    Also, iconSource was apparently not being defined correctly which
    resulted in no icons being shown in the post screen anyway. [1]
    http://developer.ubuntu.com/api/qml/sdk-
    14.04/Ubuntu.Components.ListItems.Standard/#iconName-prop (LP:
    #1261438)
 -- Ubuntu daily release <email address hidden> Mon, 17 Feb 2014 17:42:07 +0000

Changed in friends-app (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Kai Mast (kai-mast) wrote :

Seems like the replace only replaces one "\n" at a time. Think we have to reopen this bug :(

Revision history for this message
Robert Bruce Park (robru) wrote :

It just occurred to me that an easier fix for this would be to s/\n/<br />/ on the friends side.

Changed in friends-app (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Kai Mast (kai-mast) wrote :

Yeah that makes a lot more sense. Can you point me to the file that does this?

Revision history for this message
Robert Bruce Park (robru) wrote :

You'd want to perform this substitution on the value of orig_message in the Base._publish method in friends/utils/base.py. Replace the newlines with br tags at the last possible second before submitting the message into the dee model.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.