diff --git a/ActiveSync/NGVCard+ActiveSync.m b/ActiveSync/NGVCard+ActiveSync.m index 9ac476969..bb4f29248 100644 --- a/ActiveSync/NGVCard+ActiveSync.m +++ b/ActiveSync/NGVCard+ActiveSync.m @@ -40,6 +40,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import +#import + #include "NSDate+ActiveSync.h" #include "NSString+ActiveSync.h" @@ -199,6 +201,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [s appendFormat: @"%@", o]; [s appendString: @""]; } + + if ((o = [self photo])) + [s appendFormat: @"%@", o]; return s; } @@ -285,13 +290,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if ((o = [theValues objectForKey: @"Email1Address"])) { element = [self elementWithTag: @"email" ofType: @"work"]; - [element setSingleValue: o forKey: @""]; + [element setSingleValue: [o pureEMailAddress] forKey: @""]; } if ((o = [theValues objectForKey: @"Email2Address"])) { element = [self elementWithTag: @"email" ofType: @"home"]; - [element setSingleValue: o forKey: @""]; + [element setSingleValue: [o pureEMailAddress] forKey: @""]; } // SOGo currently only supports 2 email addresses ... but AS clients might send 3 @@ -299,7 +304,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if ((o = [theValues objectForKey: @"Email3Address"])) { element = [self elementWithTag: @"email" ofType: @"three"]; - [element setSingleValue: o forKey: @""]; + [element setSingleValue: [o pureEMailAddress] forKey: @""]; } // Formatted name @@ -346,6 +351,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if ((o = [theValues objectForKey: @"NickName"])) [self setNickname: o]; + + if ((o = [theValues objectForKey: @"Picture"])) + [self setPhoto: o]; + } @end diff --git a/NEWS b/NEWS index e9dd332da..c5d569491 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +2.2.6 (2014-XX-YY) +------------------ + +Enhancements + - contacts photos are now synchronized using ActiveSync (#2807) + +Bug fixes + + 2.2.5 (2014-06-05) ------------------ diff --git a/SOPE/NGCards/NGVCard.h b/SOPE/NGCards/NGVCard.h index 1d3696c63..9553da380 100644 --- a/SOPE/NGCards/NGVCard.h +++ b/SOPE/NGCards/NGVCard.h @@ -126,6 +126,9 @@ typedef enum - (void) setCategories: (NSArray *) newCategories; - (NSArray *) categories; +- (NSString *) photo; +- (void) setPhoto: (NSString *) _value; + // - (void) setN: (NGVCardName *) _v; // - (NGVCardName *) n; diff --git a/SOPE/NGCards/NGVCard.m b/SOPE/NGCards/NGVCard.m index db3833c6e..5f8028aa5 100644 --- a/SOPE/NGCards/NGVCard.m +++ b/SOPE/NGCards/NGVCard.m @@ -288,6 +288,25 @@ return [self uniqueChildWithTag: @"n"]; } +- (NSString *) photo +{ + NGVCardPhoto *photo; + + photo = (NGVCardPhoto *)[self uniqueChildWithTag: @"photo"]; + + return [[photo valuesAtIndex: 0 forKey: @""] objectAtIndex: 0]; +} + +- (void) setPhoto: (NSString *) _value +{ + CardElement *photo; + photo = [self uniqueChildWithTag: @"photo"]; + [photo setValue: 0 ofAttribute: @"encoding" to: @"BASE64"]; + + [photo setSingleValue: _value forKey: @""]; +} + + - (void) setOrg: (NSString *) anOrg units: (NSArray *) someUnits {