@@ -51,7 +51,7 @@ namespace MSNPSharp.IO
51
51
public class XMLContactList : MCLSerializer
52
52
{
53
53
public const string XMLContactListVersion = "20120219" ;
54
-
54
+
55
55
#region Members
56
56
57
57
[ NonSerialized ]
@@ -77,7 +77,7 @@ public class XMLContactList : MCLSerializer
77
77
78
78
[ NonSerialized ]
79
79
private List < ContactType > individualShellContacts = new List < ContactType > ( 0 ) ;
80
-
80
+
81
81
[ NonSerialized ]
82
82
private NSMessageHandler nsMessageHandler ;
83
83
@@ -90,14 +90,14 @@ public class XMLContactList : MCLSerializer
90
90
#endregion
91
91
92
92
#region Properties
93
-
93
+
94
94
protected NSMessageHandler NSMessageHandler
95
95
{
96
96
get
97
97
{
98
98
return nsMessageHandler ;
99
99
}
100
-
100
+
101
101
set
102
102
{
103
103
nsMessageHandler = value ;
@@ -275,8 +275,8 @@ public override void Save(string filename)
275
275
catch ( Exception ex )
276
276
{
277
277
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 ) ;
280
280
}
281
281
}
282
282
}
@@ -1060,7 +1060,6 @@ internal void SetAddressBookInfo(string abId, ABFindContactsPagedResultTypeAB ab
1060
1060
lock ( SyncObject )
1061
1061
{
1062
1062
string lowerId = abId . ToLowerInvariant ( ) ;
1063
-
1064
1063
string compareTime = GetAddressBookLastChange ( lowerId ) ;
1065
1064
1066
1065
try
@@ -1240,7 +1239,6 @@ private CircleInverseInfoType SelectWLConnection(string abId)
1240
1239
1241
1240
lock ( CircleResults )
1242
1241
return CircleResults [ lowerId ] ;
1243
-
1244
1242
}
1245
1243
1246
1244
private string [ ] SelectWLConnection ( List < string > abIds , RelationshipState state )
@@ -1274,7 +1272,6 @@ private string[] FilterWLConnections(List<string> abIds, RelationshipState state
1274
1272
{
1275
1273
List < string > returnValues = new List < string > ( 0 ) ;
1276
1274
1277
-
1278
1275
foreach ( string abId in abIds )
1279
1276
{
1280
1277
string lowerId = abId . ToLowerInvariant ( ) ;
@@ -2003,9 +2000,7 @@ internal void ClearCircleInfos()
2003
2000
2004
2001
//lock (contactTable)
2005
2002
contactTable . Clear ( ) ;
2006
-
2007
2003
}
2008
-
2009
2004
}
2010
2005
2011
2006
/// <summary>
@@ -2253,7 +2248,6 @@ private bool RestoreCircleFromAddressBook(string abId, RelationshipState state)
2253
2248
}
2254
2249
2255
2250
return true ;
2256
-
2257
2251
}
2258
2252
2259
2253
/// <summary>
@@ -2271,7 +2265,6 @@ private void RequestCircles(string[] abIds, RelationshipState state, Scenario sc
2271
2265
{
2272
2266
RequestAddressBookByABId ( abId , state , scene ) ;
2273
2267
}
2274
-
2275
2268
}
2276
2269
2277
2270
private Contact CreateGatewayContact ( NetworkInfoType networkInfo )
@@ -2285,7 +2278,6 @@ private Contact CreateGatewayContact(NetworkInfoType networkInfo)
2285
2278
Contact gatewayContact = NSMessageHandler . ContactList . GetContactWithCreate ( RemoteNetworkGateways . FaceBookGatewayAccount , IMAddressInfoType . RemoteNetwork ) ;
2286
2279
gatewayContact . Lists |= RoleLists . Forward ;
2287
2280
2288
-
2289
2281
Trace . WriteLineIf ( Settings . TraceSwitch . TraceVerbose , "Gateway " + gatewayContact + " added to network contacts" , GetType ( ) . Name ) ;
2290
2282
2291
2283
return gatewayContact ;
@@ -2295,8 +2287,8 @@ private Contact CreateGatewayContact(NetworkInfoType networkInfo)
2295
2287
"[Warning] Unknown Getway found, please implement this gateway:\r \n " +
2296
2288
"DomainTag: " + networkInfo . DomainTag + "\r \n " +
2297
2289
"DomainId: " + networkInfo . DomainId + "\r \n " +
2298
- "SourceId: " + networkInfo . SourceId + "\r \n "
2299
- ) ;
2290
+ "SourceId: " + networkInfo . SourceId + "\r \n " ) ;
2291
+
2300
2292
return null ;
2301
2293
}
2302
2294
@@ -2387,33 +2379,32 @@ private Contact CreateFaceBookContactFromShellContact(Contact coreContact, Conta
2387
2379
foreach ( NetworkInfoType networkInfo in shellContact . contactInfo . NetworkInfoList )
2388
2380
{
2389
2381
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 )
2393
2383
{
2394
-
2395
- if ( networkInfo . DomainId == DomainIds . FaceBookDomain )
2384
+ if ( networkInfo . SourceId == SourceId . FaceBook && networkInfo . DomainId == DomainIds . FaceBookDomain )
2396
2385
{
2397
-
2398
2386
facebookContact = facebookGatewayContact . ContactList . CreateShellContact (
2399
- coreContact , IMAddressInfoType . Connect ,
2400
- networkInfo . DomainTag ) ;
2401
- facebookContact . UserTileURL = new Uri ( networkInfo . UserTileURL ) ;
2387
+ coreContact , IMAddressInfoType . Connect , networkInfo . DomainTag ) ;
2402
2388
2389
+ if ( ! String . IsNullOrEmpty ( networkInfo . UserTileURL ) )
2390
+ {
2391
+ facebookContact . UserTileURL = new Uri ( networkInfo . UserTileURL ) ;
2392
+ }
2403
2393
return facebookContact ;
2404
2394
}
2405
-
2406
2395
}
2407
2396
}
2408
2397
}
2409
2398
else
2410
2399
{
2411
2400
facebookContact = facebookGatewayContact . ContactList . CreateShellContact ( coreContact , IMAddressInfoType . Connect , shellContact . contactInfo . SourceHandle . ObjectID ) ;
2401
+
2412
2402
if ( shellContact . contactInfo . URLs != null )
2413
2403
{
2414
2404
foreach ( ContactURLType contactURL in shellContact . contactInfo . URLs )
2415
2405
{
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 )
2417
2408
{
2418
2409
facebookContact . UserTileURL = new Uri ( contactURL . URL ) ;
2419
2410
}
@@ -2443,7 +2434,6 @@ private Contact CreateFaceBookContactFromShellContact(Contact coreContact, Conta
2443
2434
/// </returns>
2444
2435
private Contact CreateContactFromLinkedShellContact ( Guid personID , string sourceID )
2445
2436
{
2446
-
2447
2437
if ( ! MessengerContactLink . ContainsKey ( personID ) )
2448
2438
{
2449
2439
return null ;
@@ -2502,9 +2492,7 @@ private Contact CreateContactFromLinkedShellContact(Guid personID, string source
2502
2492
case SourceId . MySpace :
2503
2493
// MySpace contacts.
2504
2494
break ;
2505
-
2506
2495
}
2507
-
2508
2496
}
2509
2497
}
2510
2498
@@ -2931,7 +2919,6 @@ private string GetUserTileURLByDomainIdFromNetworkInfo(ContactType contact, int
2931
2919
}
2932
2920
2933
2921
return string . Empty ;
2934
-
2935
2922
}
2936
2923
2937
2924
/// <summary>
0 commit comments