|
@@ -25,15 +25,15 @@ registration_data(Props, facebook, Ori)->
|
|
|
% error_logger:info_msg("User Ori: ~p",[Ori]),
|
|
|
% error_logger:info_msg("Props: ~p",[Props]),
|
|
|
Email = email_prop(Props, facebook),
|
|
|
- [UserName|_] = string:tokens(binary_to_list(Email),"@"), Cover = case proplists:get_value(<<"cover">>,Props) of undefined -> ""; P -> case proplists:get_value(<<"source">>,P#struct.lst) of undefined -> ""; C -> binary_to_list(C) end end,
|
|
|
- OldImages = case Ori#user.images of undefined -> []; OldI -> OldI end,
|
|
|
+ [UserName|_] = string:tokens(binary_to_list(Email),"@"),
|
|
|
+ Cover = case proplists:get_value(<<"cover">>,Props) of undefined -> ""; P -> case proplists:get_value(<<"source">>,P#struct.lst) of undefined -> ""; C -> binary_to_list(C) end end,
|
|
|
Ori#user{ id = Email,
|
|
|
display_name = UserName,
|
|
|
- images = [{fb_avatar,"https://graph.facebook.com/" ++ binary_to_list(Id) ++ "/picture?type=large"},{fb_cover,Cover}|OldImages],
|
|
|
+ images = userhelper:updateProplist({fb_cover,Cover},userhelper:updateProplist({fb_avatar,"https://graph.facebook.com/" ++ binary_to_list(Id) ++ "/picture?type=large"},Ori#user.images)),
|
|
|
email = Email,
|
|
|
names = proplists:get_value(<<"first_name">>, Props),
|
|
|
surnames = proplists:get_value(<<"last_name">>, Props),
|
|
|
- tokens = [{facebook,Id}|Ori#user.tokens],
|
|
|
+ tokens = userhelper:updateProplist({facebook,Id},Ori#user.tokens),
|
|
|
birth = {element(3, BirthDay), element(1, BirthDay), element(2, BirthDay)},
|
|
|
register_date = erlang:now(),
|
|
|
status = ok }.
|