Merge lp:~ken-vandine/friends/fix-facebook-name into lp:friends

Proposed by Ken VanDine
Status: Merged
Merged at revision: 33
Proposed branch: lp:~ken-vandine/friends/fix-facebook-name
Merge into: lp:friends
Diff against target: 13 lines (+2/-1)
1 file modified
friends/protocols/facebook.py (+2/-1)
To merge this branch: bzr merge lp:~ken-vandine/friends/fix-facebook-name
Reviewer Review Type Date Requested Status
Robert Bruce Park Approve
Review via email: mp+131700@code.launchpad.net

Description of the change

Fix setting the sender's name, we don't want to see facebook ID numbers in the stream.

To post a comment you must log in.
Revision history for this message
Robert Bruce Park (robru) wrote :

On 12-10-26 06:01 PM, Ken VanDine wrote:
> from_record = entry.get('from')
> if from_record is not None:
> - args['sender'] = sender_id = from_record.get('id', '')
> + args['sender'] = from_record.get('name', '')
> + sender_id = from_record.get('id', '')
> args['icon_uri'] = Avatar.get_image(
> API_BASE.format(id=sender_id) + '/picture?type=large')
> args['sender_nick'] = from_record.get('name', '')

Ken, I had noticed this problem earlier, but I'm not sure how to handle
it. Your change makes sender_nick and sender set to the same value... is
that ok? Also, you're not storing the sender_id anywhere. Are you sure
we won't need that later for anything?

I know Facebook doesn't really have a concept of nicknames (at least not
like twitter has screen names vs display names), although some people do
have id's that aren't just random numbers. Maybe we should store the
facebook id in the sender_nick column?

Also, you have one extra space next to the equal sign, please fix that ;-)

Revision history for this message
Barry Warsaw (barry) wrote :

On Oct 26, 2012, at 11:18 PM, Robert Bruce Park wrote:

>Also, you have one extra space next to the equal sign, please fix that ;-)

Be still, my heart! :)

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Oh, sender_id wasn't used. I don't see a reason to store it. I don't know if we have a place where we need to use it at all. I would say lets just keep it the same as name.

32. By Ken VanDine

White space cleanup

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

On 12-10-26 06:52 PM, Ken VanDine wrote:
> Oh, sender_id wasn't used. I don't see a reason to store it. I don't know if we have a place where we need to use it at all. I would say lets just keep it the same as name.

Alright, fair. I can see it being needed if we wanted to present a link
to that person's profile, but if you don't intend to have such a link,
then there's no need. If we later decided we wanted to link to people's
profile pages, we could add a new model schema called 'sender_url' or
'sender_profile' or something, and just fill it with
PERMALINK.format(id=sender_id) quite easily.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'friends/protocols/facebook.py'
2--- friends/protocols/facebook.py 2012-10-25 22:39:00 +0000
3+++ friends/protocols/facebook.py 2012-10-26 23:54:21 +0000
4@@ -87,7 +87,8 @@
5
6 from_record = entry.get('from')
7 if from_record is not None:
8- args['sender'] = sender_id = from_record.get('id', '')
9+ args['sender'] = from_record.get('name', '')
10+ sender_id = from_record.get('id', '')
11 args['icon_uri'] = Avatar.get_image(
12 API_BASE.format(id=sender_id) + '/picture?type=large')
13 args['sender_nick'] = from_record.get('name', '')

Subscribers

People subscribed via source and target branches

to all changes: