Changeset 313 for apps/iphone/my.tel
- Timestamp:
- 04/17/09 07:14:20 (4 years ago)
- Location:
- apps/iphone/my.tel/trunk
- Files:
-
- 4 added
- 23 modified
-
Classes/DotTel_SDK/Classes/DnsResolver.h (modified) (3 diffs)
-
Classes/DotTel_SDK/Classes/DnsResolver.m (modified) (9 diffs)
-
Classes/DotTel_SDK/Classes/NetworkUtility.h (added)
-
Classes/DotTel_SDK/Classes/NetworkUtility.m (added)
-
Classes/DotTel_SDK/Classes/Reachability.h (added)
-
Classes/DotTel_SDK/Classes/Reachability.m (added)
-
Classes/DotTel_SDK/Classes/RecordLoc.h (modified) (1 diff)
-
Classes/DotTel_SDK/Classes/RecordLoc.m (modified) (3 diffs)
-
Classes/DotTel_SDK/Classes/RecordNaptr.h (modified) (1 diff)
-
Classes/DotTel_SDK/Classes/RecordNaptr.m (modified) (4 diffs)
-
Classes/DotTel_SDK/Classes/RecordTxt.h (modified) (1 diff)
-
Classes/DotTel_SDK/Classes/RecordTxt.m (modified) (2 diffs)
-
Classes/DotTel_SDK/README DotTel SDK (modified) (1 diff)
-
Classes/GroupFriendsController.h (modified) (1 diff)
-
Classes/GroupFriendsController.m (modified) (1 diff)
-
Classes/HeaderViewController.h (modified) (1 diff)
-
Classes/HeaderViewController.m (modified) (1 diff)
-
Classes/JsonConnection.m (modified) (1 diff)
-
Classes/KeywordViewController.m (modified) (2 diffs)
-
Classes/LoginViewController.m (modified) (1 diff)
-
Classes/ProfileViewController.m (modified) (1 diff)
-
Classes/RecordGroupsController.m (modified) (1 diff)
-
Classes/RecordViewController.m (modified) (2 diffs)
-
Classes/VIPConnect.m (modified) (3 diffs)
-
Classes/VIP_telAppDelegate.h (modified) (1 diff)
-
Classes/VIP_telAppDelegate.m (modified) (1 diff)
-
VIP.tel.xcodeproj/project.pbxproj (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/DnsResolver.h
r299 r313 4 4 // 5 5 // Created by Henri Asseily on 9/14/08. 6 // Copyright 2008 Telnic Ltd. All rights reserved. 6 /* 7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 8 9 Redistribution and use in source and binary forms, with or without modification, 10 are permitted provided that the following conditions are met: 11 12 Redistributions of source code must retain the above copyright notice, this list of conditions 13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the documentation and/or other 15 materials provided with the distribution. 16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 17 promote products derived from this software without specific prior written permission. 18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 7 27 // 8 28 // … … 18 38 #import <UIKit/UIKit.h> 19 39 #import "ldns.h" 40 #import "NetworkUtility.h" 20 41 #import "RecordNaptr.h" 21 42 #import "RecordTxt.h" … … 48 69 * 49 70 * @param aDom the domain to query 50 * @param naptrArray the array to add the naptrs to 71 * @param naptrArray the array to add the naptrs to 72 * @return the number of NAPTR records in the domain. 0 should mean error 51 73 * 52 74 */ 53 - ( void)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error;75 - (NSUInteger)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error; 54 76 55 77 /** -
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/DnsResolver.m
r299 r313 4 4 // 5 5 // Created by Henri Asseily on 9/14/08. 6 // Copyright 2008 Telnic Ltd. All rights reserved. 6 /* 7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 8 9 Redistribution and use in source and binary forms, with or without modification, 10 are permitted provided that the following conditions are met: 11 12 Redistributions of source code must retain the above copyright notice, this list of conditions 13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the documentation and/or other 15 materials provided with the distribution. 16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 17 promote products derived from this software without specific prior written permission. 18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 7 27 // 8 28 … … 29 49 } 30 50 31 - ( void)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error {51 - (NSUInteger)getNAPTRForTel:(NSString *)aDom inArray:(NSMutableArray *)naptrArray withError:(NSError **)error { 32 52 [aDom retain]; 33 53 ldns_rr_list *naptrs = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_NAPTR fromDomain:aDom withError:error]; 34 54 [aDom release]; 35 55 if (!naptrs) { 36 return ;56 return 0; 37 57 } 38 58 39 59 NSDate *lookupDate = [[NSDate date] retain]; 40 NSUInteger i, count = ldns_rr_list_rr_count(naptrs); 60 NSUInteger i; 61 NSUInteger count = ldns_rr_list_rr_count(naptrs); 41 62 42 63 for (i = 0; i < count; i++) { … … 53 74 [lookupDate release]; 54 75 55 return ;76 return count; 56 77 57 78 } … … 64 85 ldns_rr_list *txts = [self retrieveResourceRecordsOfType:LDNS_RR_TYPE_TXT fromDomain:domain withError:error]; 65 86 if (!txts) { 66 _headerText = [NSMutableString stringWithString:@""];67 87 return _headerText; 68 88 } 69 89 70 90 NSDate *lookupDate = [[NSDate date] retain]; 71 NSUInteger i, count = ldns_rr_list_rr_count(txts); 91 NSUInteger i; 92 NSUInteger count = ldns_rr_list_rr_count(txts); 72 93 73 94 for (i = 0; i < count; i++) { … … 78 99 _headerText = [NSMutableString stringWithString:theRec.textValue]; 79 100 } else { 80 NSLog(theRec.textValue);101 //NSLog(theRec.textValue); 81 102 [_headerText appendFormat:@"\n %@", theRec.textValue]; 82 103 } … … 140 161 ldns_resolver_set_debug(resolver, TRUE); 141 162 #endif 142 ldns_resolver_set_edns_udp_size(resolver, 8000); 163 // Set ldns defaults. Here's how it'll work: 164 165 ldns_resolver_set_usevc(resolver, TRUE); // use TCP by default for now. TODO: look at UDP behavior in GPRS/EDGE 166 ldns_resolver_set_edns_udp_size(resolver, 4096); // with a 4k max packet size when in UDP EDNS0 167 ldns_resolver_set_fallback(resolver, TRUE); // fallback to EDNS0 UDP, and then to TCP 168 ldns_resolver_set_fail(resolver, FALSE); // do not allow to fail to next nameserver 169 ldns_resolver_set_retry(resolver, 4); // Max number of retries 170 ldns_resolver_set_retrans(resolver, 2); // Seconds between retries 143 171 return resolver; 144 172 } else { … … 158 186 dict = [NSDictionary dictionaryWithObject:@"DNS Error: Can't parse resolver name" forKey:NSLocalizedDescriptionKey]; 159 187 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_NO_NAME userInfo:dict]; 160 *error = err2; 188 if (error) 189 *error = err2; 161 190 return NULL; 162 191 } … … 164 193 ldns_pkt *p; 165 194 195 // @synchronized([self class]) { 196 166 197 p = ldns_resolver_query(res, 167 198 ldnsdomain, … … 169 200 LDNS_RR_CLASS_IN, 170 201 LDNS_RD); 171 172 if (!p) { 173 //NSLog(@"Can't do ldns_resolver_query"); 174 dict = [NSDictionary dictionaryWithObject:@"Network Error: No Internet Connection" forKey:NSLocalizedDescriptionKey]; 175 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_NO_CONNECTION userInfo:dict]; 176 *error = err2; 177 return NULL; 178 } 179 180 /* retrieve the records from the answer section of that 181 * packet 182 */ 183 rrlist = ldns_pkt_rr_list_by_type(p, 184 rrType, 185 LDNS_SECTION_ANSWER); 186 if (!rrlist) { 187 //NSLog(@" *** invalid answer name after query\n"); 188 ldns_pkt_free(p); 189 dict = [NSDictionary dictionaryWithObject:@"Data Error: Invalid DNS Answer" forKey:NSLocalizedDescriptionKey]; 190 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_INVALID_ANSWER userInfo:dict]; 191 *error = err2; 192 return NULL; 193 } 194 195 // Check if rrlist is really ok 196 @try { 197 ldns_rr_list_rr_count(rrlist); 198 } 199 @catch (NSException * e) { 200 dict = [NSDictionary dictionaryWithObject:@"Network Error: Bad data returned" forKey:NSLocalizedDescriptionKey]; 201 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_BAD_DATA userInfo:dict]; 202 *error = err2; 203 rrlist = NULL; 204 } 205 206 ldns_pkt_free(p); 202 203 ldns_rdf_free(ldnsdomain); 204 205 // Have to play the switch game to encapsulate everything in one potentially synchronized block, with one return statement 206 switch (1) { 207 case 1: // always check for existence of p 208 if (!p) { 209 //NSLog(@"Can't do ldns_resolver_query"); 210 dict = [NSDictionary dictionaryWithObject:@"Network Error: Could not connect to server" forKey:NSLocalizedDescriptionKey]; 211 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_NO_CONNECTION userInfo:dict]; 212 if (error) 213 *error = err2; 214 // recreate a resolver for later 215 ldns_resolver_deep_free(res); 216 res = [self createLdnsResolver]; 217 rrlist = NULL; 218 break; 219 } 220 case 2: // p exists, check for existence of rrlist answer 221 /* retrieve the records from the answer section of that 222 * packet 223 */ 224 rrlist = ldns_pkt_rr_list_by_type(p, 225 rrType, 226 LDNS_SECTION_ANSWER); 227 if (!rrlist) { 228 //NSLog(@" *** invalid answer name after query\n"); 229 ldns_pkt_free(p); 230 dict = [NSDictionary dictionaryWithObject:@"Data Error: Invalid DNS Answer" forKey:NSLocalizedDescriptionKey]; 231 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_INVALID_ANSWER userInfo:dict]; 232 if (error) 233 *error = err2; 234 rrlist = NULL; 235 break; 236 } 237 case 3: // rrlist exists, make sure it's ok 238 @try { 239 ldns_rr_list_rr_count(rrlist); 240 } 241 @catch (NSException * e) { 242 dict = [NSDictionary dictionaryWithObject:@"Network Error: Bad data returned" forKey:NSLocalizedDescriptionKey]; 243 err2 = [NSError errorWithDomain:@"org.telnic.tel.sdk" code:RESOLVER_STATUS_BAD_DATA userInfo:dict]; 244 if (error) 245 *error = err2; 246 rrlist = NULL; 247 } 248 ldns_pkt_free(p); 249 break; 250 default: 251 break; 252 } 253 // } // end @synchronized 254 207 255 return rrlist; 208 256 } -
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordLoc.h
r217 r313 4 4 // 5 5 // Created by Henri Asseily on 9/13/08. 6 // Copyright 2008 Telnic Ltd. All rights reserved. 6 /* 7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 8 9 Redistribution and use in source and binary forms, with or without modification, 10 are permitted provided that the following conditions are met: 11 12 Redistributions of source code must retain the above copyright notice, this list of conditions 13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the documentation and/or other 15 materials provided with the distribution. 16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 17 promote products derived from this software without specific prior written permission. 18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 7 27 // 8 28 -
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordLoc.m
r217 r313 4 4 // 5 5 // Created by Henri Asseily on 9/13/08. 6 // Copyright 2008 Telnic Ltd. All rights reserved. 6 /* 7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 8 9 Redistribution and use in source and binary forms, with or without modification, 10 are permitted provided that the following conditions are met: 11 12 Redistributions of source code must retain the above copyright notice, this list of conditions 13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the documentation and/or other 15 materials provided with the distribution. 16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 17 promote products derived from this software without specific prior written permission. 18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 7 27 // 8 28 … … 58 78 } 59 79 60 uint8_t size;80 // uint8_t size; 61 81 uint32_t horizontal_precision; 62 82 uint32_t vertical_precision; … … 70 90 uint32_t equator = (uint32_t) ldns_power(2, 31); 71 91 72 size = ldns_rdf_data(rdf)[1]; // CLLocation doesn't use it92 // size = ldns_rdf_data(rdf)[1]; // CLLocation doesn't use it 73 93 horizontal_precision = ldns_rdf_data(rdf)[2]; 74 94 vertical_precision = ldns_rdf_data(rdf)[3]; -
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordNaptr.h
r217 r313 4 4 // 5 5 // Created by Henri Asseily on 9/12/08. 6 // Copyright 2008 Telnic Ltd. All rights reserved. 6 /* 7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 8 9 Redistribution and use in source and binary forms, with or without modification, 10 are permitted provided that the following conditions are met: 11 12 Redistributions of source code must retain the above copyright notice, this list of conditions 13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the documentation and/or other 15 materials provided with the distribution. 16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 17 promote products derived from this software without specific prior written permission. 18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 7 27 // 8 28 -
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordNaptr.m
r299 r313 4 4 // 5 5 // Created by Henri Asseily on 9/12/08. 6 // Copyright 2008 Telnic Ltd. All rights reserved. 6 /* 7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 8 9 Redistribution and use in source and binary forms, with or without modification, 10 are permitted provided that the following conditions are met: 11 12 Redistributions of source code must retain the above copyright notice, this list of conditions 13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the documentation and/or other 15 materials provided with the distribution. 16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 17 promote products derived from this software without specific prior written permission. 18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 7 27 // 8 28 … … 99 119 } else { 100 120 // Clean Regexp (don't bother with regex, just assume it's a full overwrite) 101 NSArray *regexParts = [regexp componentsSeparatedByString:@"!"]; 102 uriContent = [[NSString stringWithString:[regexParts objectAtIndex:2]] retain]; 103 } 121 NSString *regexSeparator = [regexp substringToIndex:1]; 122 NSArray *regexParts = [regexp componentsSeparatedByString:regexSeparator]; 123 if ([regexParts count] == 4) { 124 // looks like a regex 125 // TODO: Should check that index 3 is empty or the flag "i" 126 // http://www.ietf.org/rfc/rfc2915.txt 127 uriContent = [NSString stringWithString:[regexParts objectAtIndex:2]]; 128 } else { // Not valid 129 return self; 130 } 131 } 132 labelDescription = [[self generateLabelDescription] retain]; 104 133 105 134 } else if ([flags isEqualToString:@""]) { // Non-terminal naptr 106 135 isTerminal = NO; 107 136 replacement = [self stringFromDnameRdf:ldns_rr_rdf(rr,5)]; 108 uriContent = [replacement retain]; 137 labelDescription = [[[replacement stringByReplacingOccurrencesOfString:@"-" withString:@" "] capitalizedString] retain]; 138 uriContent = replacement; 109 139 110 140 } else { // Not valid … … 113 143 114 144 serviceDescription = [[self generateServiceDescription] retain]; 115 labelDescription = [[self generateLabelDescription] retain]; 116 145 [uriContent retain]; 117 146 isValid = YES; 118 147 return self; … … 179 208 } 180 209 210 i = 0; 181 211 for (aPart in serviceTypeArray) { 182 212 NSMutableString *strVal = [NSMutableString stringWithString:LocTelStr(aPart)]; -
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordTxt.h
r217 r313 4 4 // 5 5 // Created by Henri Asseily on 9/13/08. 6 // Copyright 2008 Telnic Ltd. All rights reserved. 6 /* 7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 8 9 Redistribution and use in source and binary forms, with or without modification, 10 are permitted provided that the following conditions are met: 11 12 Redistributions of source code must retain the above copyright notice, this list of conditions 13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the documentation and/or other 15 materials provided with the distribution. 16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 17 promote products derived from this software without specific prior written permission. 18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 7 27 // 8 28 -
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/Classes/RecordTxt.m
r299 r313 4 4 // 5 5 // Created by Henri Asseily on 9/13/08. 6 // Copyright 2008 Telnic Ltd. All rights reserved. 6 /* 7 Copyright (c) 2008, Telnic Ltd. All rights reserved. 8 9 Redistribution and use in source and binary forms, with or without modification, 10 are permitted provided that the following conditions are met: 11 12 Redistributions of source code must retain the above copyright notice, this list of conditions 13 and the following disclaimer. Redistributions in binary form must reproduce the above copyright 14 notice, this list of conditions and the following disclaimer in the documentation and/or other 15 materials provided with the distribution. 16 Neither the name of the Telnic Ltd. nor the names of its contributors may be used to endorse or 17 promote products derived from this software without specific prior written permission. 18 THIS DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 19 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 7 27 // 8 28 … … 75 95 } 76 96 77 textValue = [ [stringComponents componentsJoinedByString:@", "] retain];97 textValue = [stringComponents componentsJoinedByString:@", "]; 78 98 isValid = YES; 79 99 } -
apps/iphone/my.tel/trunk/Classes/DotTel_SDK/README DotTel SDK
r217 r313 15 15 - Allocate and initialize an instance of DnsResolver 16 16 - Create empty mutable arrays to hold NAPTR, TXT and LOC records 17 - Call the DnsResolver methods getNaptrForTel:inArray: and related17 - Call the DnsResolver methods getNaptrForTel:inArray:withError: and related 18 18 19 19 You now have easy access to all relevant .tel data for a domain. -
apps/iphone/my.tel/trunk/Classes/GroupFriendsController.h
r273 r313 27 27 NSMutableArray *allFriendsArray; // array with all the friends (raw JSON of getgroupfriends on allfriends group) 28 28 NSMutableArray *selectedFriends; // 0/1 flags for each object of allFriendsArray to say if they're selected or not 29 NSMutableArray *tableData; // actual table datasource30 29 NSString *newGroupName; 31 30 UIButton *renameButton; -
apps/iphone/my.tel/trunk/Classes/GroupFriendsController.m
r273 r313 531 531 NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet]; 532 532 for (i = 0; i < count; i++) { 533 NSLog(@"working on index: %d", i);534 533 if ([selectedFriends objectAtIndex:i] == nFalse) { 535 534 [indexes addIndex:i]; -
apps/iphone/my.tel/trunk/Classes/HeaderViewController.h
r266 r313 27 27 NSString *previousHeaderString; 28 28 // Below for keyboard notification 29 UIView *activeField;30 29 BOOL keyboardShown; 31 30 } -
apps/iphone/my.tel/trunk/Classes/HeaderViewController.m
r266 r313 215 215 216 216 NSMutableDictionary *requestData = [[NSMutableDictionary dictionaryWithCapacity:2] retain]; 217 NSLog([[VIPConnect sharedInstance].selectedDomain description]);218 217 [requestData setObject:[VIPConnect sharedInstance].selectedDomain forKey:@"domainName"]; 219 218 [requestData setObject:[VIPConnect sharedInstance].selectedProfileId forKey:@"profileId"]; -
apps/iphone/my.tel/trunk/Classes/JsonConnection.m
r271 r313 164 164 } 165 165 NSString *theJSONResult; 166 theJSONResult = [[ NSString alloc] initWithData:reqResults encoding:NSUTF8StringEncoding];166 theJSONResult = [[[NSString alloc] initWithData:reqResults encoding:NSUTF8StringEncoding] autorelease]; 167 167 168 168 #ifdef JSONDEBUG -
apps/iphone/my.tel/trunk/Classes/KeywordViewController.m
r286 r313 231 231 NSMutableDictionary *uiItem; 232 232 if (!jsonItem) { 233 return uiItem;233 return NULL; 234 234 } 235 235 uiItem = [NSMutableDictionary dictionaryWithCapacity:7]; … … 365 365 return; 366 366 367 NSString *newId ;367 NSString *newId = NULL; 368 368 if ([[aRec objectForKey:@"primaryKeywordId"] integerValue] == 0) { 369 369 // new keyword -
apps/iphone/my.tel/trunk/Classes/LoginViewController.m
r299 r313 170 170 if (!aDomain) 171 171 return nil; 172 // activate a connection 173 NSMutableURLRequest *urlReq = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]; 174 [urlReq setHTTPMethod:@"HEAD"]; 175 [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; 176 NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:urlReq delegate:self startImmediately:YES]; 177 if (!theConnection) { 178 [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 179 NSDictionary *dict = [NSDictionary dictionaryWithObject:@"Network Error: No Internet Connection" forKey:NSLocalizedDescriptionKey]; 180 NSError *err2; 181 err2 = [NSError errorWithDomain:@"org.telnic.my.tel" code:666 userInfo:dict]; 182 *error = err2; 183 return nil; 184 } 185 // Data connection activation is now started 172 if ([aDomain hasSuffix:@".vip.tel"]) { 173 return @"https://demo.vip.tel/g2/json"; 174 } 186 175 // try to autoprovision apiRootUrl 187 176 NSMutableArray *naptrArray = [[NSMutableArray arrayWithCapacity:1] retain]; -
apps/iphone/my.tel/trunk/Classes/ProfileViewController.m
r266 r313 350 350 // }; 351 351 352 NSDecimalNumber *newProfileId ;352 NSDecimalNumber *newProfileId = NULL; 353 353 if (!aProfName) { 354 return newProfileId;354 return NULL; 355 355 } 356 356 [aProfName retain]; -
apps/iphone/my.tel/trunk/Classes/RecordGroupsController.m
r266 r313 236 236 } 237 237 [tableView deselectRowAtIndexPath:indexPath animated:YES]; 238 NSLog(@"GROUP COUNT: %d\n", ctGroups);239 238 } 240 239 -
apps/iphone/my.tel/trunk/Classes/RecordViewController.m
r287 r313 263 263 [aiV startAnimating]; 264 264 UIBarButtonItem *savingButton = [[UIBarButtonItem alloc] initWithCustomView:aiV]; 265 [aiV release]; 265 266 self.navigationItem.rightBarButtonItem = savingButton; 266 267 [self orderRecords]; … … 340 341 NSMutableDictionary *uiItem; 341 342 if (!jsonItem) { 342 return uiItem;343 return NULL; 343 344 } 344 345 uiItem = [NSMutableDictionary dictionaryWithCapacity:7]; -
apps/iphone/my.tel/trunk/Classes/VIPConnect.m
r243 r313 40 40 41 41 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 42 NSString *aaa = [defaults stringForKey:@"apiRootUrl"]; 43 if ((!aaa) || (![aaa hasPrefix:@"http"])) { 44 return; 45 } 42 46 NSDictionary *loginInfo = [NSDictionary dictionaryWithObjectsAndKeys: 43 47 [defaults stringForKey:@"loginName"], @"userName", … … 52 56 NSURL *theUrl = [NSURL URLWithString:loginString]; 53 57 54 JsonConnection *conn = [[[JsonConnection alloc] init] retain];58 JsonConnection *conn = [[[JsonConnection alloc] init] autorelease]; 55 59 if ([conn.delegate offlineMode]) { 56 60 // auto-login in offline debugging mode … … 90 94 91 95 - (void)retrieveProfiles { 92 Profile *conn = [[[Profile alloc] init] retain];96 Profile *conn = [[[Profile alloc] init] autorelease]; 93 97 [conn setTheDelegate:self]; 94 98 [conn setActionSel:@selector(doNothing:)]; -
apps/iphone/my.tel/trunk/Classes/VIP_telAppDelegate.h
r241 r313 10 10 #import "VIPConnect.h" 11 11 #import "LoginViewController.h" 12 #import "NetworkUtility.h" 12 13 13 14 @interface VIP_telAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate, JsonConnectionDelegate> { -
apps/iphone/my.tel/trunk/Classes/VIP_telAppDelegate.m
r299 r313 27 27 } 28 28 } 29 if (!offlineMode) { 30 // Start the networking by opening a write stream 31 NetworkUtility *nUtil = [NetworkUtility sharedInstance]; 32 if ([nUtil startNetwork] == NotReachable) { 33 NSDictionary *dict = [NSDictionary dictionaryWithObject:@"Network Error: No Internet Connection" forKey:NSLocalizedDescriptionKey]; 34 NSError *error; 35 error = [NSError errorWithDomain:@"org.telnic.my.tel" code:666 userInfo:dict]; 36 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"" 37 message:[error localizedDescription] 38 delegate:nil 39 cancelButtonTitle:NSLocalizedString(@"OK", nil) 40 otherButtonTitles:nil]; 41 [alertView show]; 42 [alertView release]; 43 } 44 } 29 45 30 46 [window addSubview:loginController.view]; -
apps/iphone/my.tel/trunk/VIP.tel.xcodeproj/project.pbxproj
r299 r313 164 164 389604F30ECF2A99003F8B10 /* APILocRecord.plist in Resources */ = {isa = PBXBuildFile; fileRef = 389604F00ECF2A99003F8B10 /* APILocRecord.plist */; }; 165 165 389604F40ECF2A99003F8B10 /* APINaptrRecord.plist in Resources */ = {isa = PBXBuildFile; fileRef = 389604F10ECF2A99003F8B10 /* APINaptrRecord.plist */; }; 166 389AC2AF0F8D3C2200400977 /* NetworkUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 389AC2AB0F8D3C2200400977 /* NetworkUtility.m */; }; 167 389AC2B00F8D3C2200400977 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 389AC2AC0F8D3C2200400977 /* Reachability.m */; }; 166 168 38B8E7D90F6349F000373333 /* RecordGroupsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E7D80F6349F000373333 /* RecordGroupsController.m */; }; 167 169 38B8E7DD0F634B0800373333 /* RecordGroups.xib in Resources */ = {isa = PBXBuildFile; fileRef = 38B8E7DC0F634B0800373333 /* RecordGroups.xib */; }; … … 409 411 389604F00ECF2A99003F8B10 /* APILocRecord.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = APILocRecord.plist; sourceTree = "<group>"; }; 410 412 389604F10ECF2A99003F8B10 /* APINaptrRecord.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = APINaptrRecord.plist; sourceTree = "<group>"; }; 413 389AC2AB0F8D3C2200400977 /* NetworkUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkUtility.m; sourceTree = "<group>"; }; 414 389AC2AC0F8D3C2200400977 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; }; 415 389AC2AD0F8D3C2200400977 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; }; 416 389AC2AE0F8D3C2200400977 /* NetworkUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkUtility.h; sourceTree = "<group>"; }; 411 417 38B8E7D70F6349F000373333 /* RecordGroupsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordGroupsController.h; sourceTree = "<group>"; }; 412 418 38B8E7D80F6349F000373333 /* RecordGroupsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecordGroupsController.m; sourceTree = "<group>"; }; … … 568 574 383FE4710F333380008A9342 /* DnsResolver.h */, 569 575 383FE4720F333380008A9342 /* DnsResolver.m */, 576 389AC2AB0F8D3C2200400977 /* NetworkUtility.m */, 577 389AC2AC0F8D3C2200400977 /* Reachability.m */, 578 389AC2AD0F8D3C2200400977 /* Reachability.h */, 579 389AC2AE0F8D3C2200400977 /* NetworkUtility.h */, 570 580 383FE4730F333380008A9342 /* RecordLoc.h */, 571 581 383FE4740F333380008A9342 /* RecordLoc.m */, … … 1096 1106 382FDD450F3C547E0021A935 /* GroupFriendsController.m in Sources */, 1097 1107 38B8E7D90F6349F000373333 /* RecordGroupsController.m in Sources */, 1108 389AC2AF0F8D3C2200400977 /* NetworkUtility.m in Sources */, 1109 389AC2B00F8D3C2200400977 /* Reachability.m in Sources */, 1098 1110 ); 1099 1111 runOnlyForDeploymentPostprocessing = 0; … … 1156 1168 GCC_WARN_UNUSED_VARIABLE = YES; 1157 1169 PREBINDING = NO; 1170 PROVISIONING_PROFILE = "DC881623-4681-45BB-B714-179F016CBFD9"; 1158 1171 SDKROOT = iphoneos2.1; 1159 1172 };








