Skip to content

Commit

Permalink
Correctly handle profile information
Browse files Browse the repository at this point in the history
  • Loading branch information
02strich committed Oct 1, 2011
1 parent 450714c commit 042e423
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions GravatarOSC/OSCSession.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Gravatar.NET;
using OutlookSocialProvider;

namespace GravatarOSC
Expand Down Expand Up @@ -40,7 +41,7 @@ class OSCSession : ISocialSession, ISocialSession2 {

#region Person/People
/// <summary>
/// ???
/// not yet clear, what this is used for
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
Expand Down Expand Up @@ -74,15 +75,27 @@ class OSCSession : ISocialSession, ISocialSession2 {
if(index == -1) continue;

// get gravatar profile
_provider.GravatarService.

resultList.Add(new OSCSchema.personType {
userID = personAddress.hashedAddress[index],
pictureUrl = String.Format("http://www.gravatar.com/avatar/{0}", personAddress.hashedAddress[index]),
var profile = GravatarService.GetGravatarProfile(personAddress.hashedAddress[index], true);
if (profile == null)
resultList.Add(new OSCSchema.personType {
userID = personAddress.hashedAddress[index],
pictureUrl = GravatarService.GetGravatarUrlForAddress(personAddress.hashedAddress[index], true),

index = personAddress.index,
indexSpecified = true
});
index = personAddress.index,
indexSpecified = true
});
else
resultList.Add(new OSCSchema.personType {
userID = personAddress.hashedAddress[index],
pictureUrl = profile.ThumbnailUrl,
city = profile.CurrentLocation,
firstName = profile.GivenName,
lastName = profile.FamilyName,
nickname = profile.PreferredUsername,

index = personAddress.index,
indexSpecified =true
});
}


Expand Down

0 comments on commit 042e423

Please sign in to comment.