Skip to content

Commit 7c81872

Browse files
committed
Fixed issue 316
Update issue 316 Labels: Milestone-Release5.0.2
1 parent c5f14f2 commit 7c81872

File tree

1 file changed

+18
-31
lines changed

1 file changed

+18
-31
lines changed

MSNPSharp/IO/XMLContactList.cs

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace MSNPSharp.IO
5151
public class XMLContactList : MCLSerializer
5252
{
5353
public const string XMLContactListVersion = "20120219";
54-
54+
5555
#region Members
5656

5757
[NonSerialized]
@@ -77,7 +77,7 @@ public class XMLContactList : MCLSerializer
7777

7878
[NonSerialized]
7979
private List<ContactType> individualShellContacts = new List<ContactType>(0);
80-
80+
8181
[NonSerialized]
8282
private NSMessageHandler nsMessageHandler;
8383

@@ -90,14 +90,14 @@ public class XMLContactList : MCLSerializer
9090
#endregion
9191

9292
#region Properties
93-
93+
9494
protected NSMessageHandler NSMessageHandler
9595
{
9696
get
9797
{
9898
return nsMessageHandler;
9999
}
100-
100+
101101
set
102102
{
103103
nsMessageHandler = value;
@@ -275,8 +275,8 @@ public override void Save(string filename)
275275
catch (Exception ex)
276276
{
277277
Trace.WriteLineIf(Settings.TraceSwitch.TraceError,
278-
"An error occurs while saving the Addressbook, StackTrace:\r\n" +
279-
ex.StackTrace);
278+
"An error occurs while saving the Addressbook, StackTrace:\r\n" +
279+
ex.StackTrace);
280280
}
281281
}
282282
}
@@ -1060,7 +1060,6 @@ internal void SetAddressBookInfo(string abId, ABFindContactsPagedResultTypeAB ab
10601060
lock (SyncObject)
10611061
{
10621062
string lowerId = abId.ToLowerInvariant();
1063-
10641063
string compareTime = GetAddressBookLastChange(lowerId);
10651064

10661065
try
@@ -1240,7 +1239,6 @@ private CircleInverseInfoType SelectWLConnection(string abId)
12401239

12411240
lock (CircleResults)
12421241
return CircleResults[lowerId];
1243-
12441242
}
12451243

12461244
private string[] SelectWLConnection(List<string> abIds, RelationshipState state)
@@ -1274,7 +1272,6 @@ private string[] FilterWLConnections(List<string> abIds, RelationshipState state
12741272
{
12751273
List<string> returnValues = new List<string>(0);
12761274

1277-
12781275
foreach (string abId in abIds)
12791276
{
12801277
string lowerId = abId.ToLowerInvariant();
@@ -2003,9 +2000,7 @@ internal void ClearCircleInfos()
20032000

20042001
//lock (contactTable)
20052002
contactTable.Clear();
2006-
20072003
}
2008-
20092004
}
20102005

20112006
/// <summary>
@@ -2253,7 +2248,6 @@ private bool RestoreCircleFromAddressBook(string abId, RelationshipState state)
22532248
}
22542249

22552250
return true;
2256-
22572251
}
22582252

22592253
/// <summary>
@@ -2271,7 +2265,6 @@ private void RequestCircles(string[] abIds, RelationshipState state, Scenario sc
22712265
{
22722266
RequestAddressBookByABId(abId, state, scene);
22732267
}
2274-
22752268
}
22762269

22772270
private Contact CreateGatewayContact(NetworkInfoType networkInfo)
@@ -2285,7 +2278,6 @@ private Contact CreateGatewayContact(NetworkInfoType networkInfo)
22852278
Contact gatewayContact = NSMessageHandler.ContactList.GetContactWithCreate(RemoteNetworkGateways.FaceBookGatewayAccount, IMAddressInfoType.RemoteNetwork);
22862279
gatewayContact.Lists |= RoleLists.Forward;
22872280

2288-
22892281
Trace.WriteLineIf(Settings.TraceSwitch.TraceVerbose, "Gateway " + gatewayContact + " added to network contacts", GetType().Name);
22902282

22912283
return gatewayContact;
@@ -2295,8 +2287,8 @@ private Contact CreateGatewayContact(NetworkInfoType networkInfo)
22952287
"[Warning] Unknown Getway found, please implement this gateway:\r\n" +
22962288
"DomainTag: " + networkInfo.DomainTag + "\r\n" +
22972289
"DomainId: " + networkInfo.DomainId + "\r\n" +
2298-
"SourceId: " + networkInfo.SourceId + "\r\n"
2299-
);
2290+
"SourceId: " + networkInfo.SourceId + "\r\n");
2291+
23002292
return null;
23012293
}
23022294

@@ -2387,33 +2379,32 @@ private Contact CreateFaceBookContactFromShellContact(Contact coreContact, Conta
23872379
foreach (NetworkInfoType networkInfo in shellContact.contactInfo.NetworkInfoList)
23882380
{
23892381
if (!String.IsNullOrEmpty(networkInfo.DomainTag) &&
2390-
networkInfo.DomainTag != WebServiceConstants.NullDomainTag &&
2391-
networkInfo.SourceId == SourceId.FaceBook &&
2392-
networkInfo.DomainId == DomainIds.FaceBookDomain)
2382+
networkInfo.DomainTag != WebServiceConstants.NullDomainTag)
23932383
{
2394-
2395-
if (networkInfo.DomainId == DomainIds.FaceBookDomain)
2384+
if (networkInfo.SourceId == SourceId.FaceBook && networkInfo.DomainId == DomainIds.FaceBookDomain)
23962385
{
2397-
23982386
facebookContact = facebookGatewayContact.ContactList.CreateShellContact(
2399-
coreContact, IMAddressInfoType.Connect,
2400-
networkInfo.DomainTag);
2401-
facebookContact.UserTileURL = new Uri(networkInfo.UserTileURL);
2387+
coreContact, IMAddressInfoType.Connect, networkInfo.DomainTag);
24022388

2389+
if (!String.IsNullOrEmpty(networkInfo.UserTileURL))
2390+
{
2391+
facebookContact.UserTileURL = new Uri(networkInfo.UserTileURL);
2392+
}
24032393
return facebookContact;
24042394
}
2405-
24062395
}
24072396
}
24082397
}
24092398
else
24102399
{
24112400
facebookContact = facebookGatewayContact.ContactList.CreateShellContact(coreContact, IMAddressInfoType.Connect, shellContact.contactInfo.SourceHandle.ObjectID);
2401+
24122402
if (shellContact.contactInfo.URLs != null)
24132403
{
24142404
foreach (ContactURLType contactURL in shellContact.contactInfo.URLs)
24152405
{
2416-
if (contactURL.URLType == URLType.Other && contactURL.URLName == URLName.UserTileXL)
2406+
if (String.IsNullOrEmpty(contactURL.URL) == false &&
2407+
contactURL.URLType == URLType.Other && contactURL.URLName == URLName.UserTileXL)
24172408
{
24182409
facebookContact.UserTileURL = new Uri(contactURL.URL);
24192410
}
@@ -2443,7 +2434,6 @@ private Contact CreateFaceBookContactFromShellContact(Contact coreContact, Conta
24432434
/// </returns>
24442435
private Contact CreateContactFromLinkedShellContact(Guid personID, string sourceID)
24452436
{
2446-
24472437
if (!MessengerContactLink.ContainsKey(personID))
24482438
{
24492439
return null;
@@ -2502,9 +2492,7 @@ private Contact CreateContactFromLinkedShellContact(Guid personID, string source
25022492
case SourceId.MySpace:
25032493
// MySpace contacts.
25042494
break;
2505-
25062495
}
2507-
25082496
}
25092497
}
25102498

@@ -2931,7 +2919,6 @@ private string GetUserTileURLByDomainIdFromNetworkInfo(ContactType contact, int
29312919
}
29322920

29332921
return string.Empty;
2934-
29352922
}
29362923

29372924
/// <summary>

0 commit comments

Comments
 (0)