Skip to content

Commit

Permalink
1. The description of the custom message;
Browse files Browse the repository at this point in the history
2. Reachability replaces the file name.
  • Loading branch information
Brett committed Jun 7, 2024
1 parent cc5b963 commit d3cc2d1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion OpenIMSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'OpenIMSDK'
s.version = '3.5.1'
s.version = '3.5.1+1'
s.summary = 'Open-IM-SDK'

# This description is used to generate tags and improve search results.
Expand Down
10 changes: 5 additions & 5 deletions OpenIMSDK/Interface/OIMManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
//

#import "OIMManager.h"
#import "Reachability.h"
#import "OIMReachability.h"
#import "CallbackProxy.h"

@interface OIMManager ()
{
OIMCallbacker *_callbacker;
Reachability *internetReachability;
OIMReachability *internetReachability;
}

@end
Expand Down Expand Up @@ -50,7 +50,7 @@ - (instancetype)init {
name:kReachabilityChangedNotification
object:nil];

internetReachability = [Reachability reachabilityForInternetConnection];
internetReachability = [OIMReachability reachabilityForInternetConnection];
[internetReachability startNotifier];
}

Expand Down Expand Up @@ -105,8 +105,8 @@ - (void)applicationWillEnterForeground:(NSNotification *)note {
}

- (void)reachabilityChanged:(NSNotification *)note {
Reachability *reachability = [note object];
NSParameterAssert([reachability isKindOfClass:[Reachability class]]);
OIMReachability *reachability = [note object];
NSParameterAssert([reachability isKindOfClass:[OIMReachability class]]);

CallbackProxy *callback = [[CallbackProxy alloc]initWithOnSuccess:^(NSString * _Nullable data) {

Expand Down
2 changes: 1 addition & 1 deletion OpenIMSDK/Model/OIMCustomElem.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, nullable, copy) NSString *extension;

@property (nonatomic, nullable, copy) NSString *description;
@property (nonatomic, nullable, copy) NSString *description_;

@end

Expand Down
7 changes: 6 additions & 1 deletion OpenIMSDK/Model/OIMCustomElem.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
//

#import "OIMCustomElem.h"
#import <MJExtension/MJExtension.h>

@implementation OIMCustomElem
@synthesize description;

+ (NSDictionary *)mj_replacedKeyFromPropertyName {
return @{@"description_" : @"description"};
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ typedef enum : NSInteger {
extern NSString *kReachabilityChangedNotification;


@interface Reachability : NSObject
@interface OIMReachability : NSObject

/*!
* Use to check the reachability of a given host name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#import <CoreFoundation/CoreFoundation.h>

#import "Reachability.h"
#import "OIMReachability.h"

#pragma mark IPv6 Support
//Reachability fully support IPv6. For full details, see ReadMe.md.
Expand Down Expand Up @@ -52,24 +52,24 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
{
#pragma unused (target, flags)
NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");
NSCAssert([(__bridge NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback");
NSCAssert([(__bridge NSObject*) info isKindOfClass: [OIMReachability class]], @"info was wrong class in ReachabilityCallback");

Reachability* noteObject = (__bridge Reachability *)info;
OIMReachability* noteObject = (__bridge OIMReachability *)info;
// Post a notification to notify the client that the network reachability changed.
[[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject];
}


#pragma mark - Reachability implementation

@implementation Reachability
@implementation OIMReachability
{
SCNetworkReachabilityRef _reachabilityRef;
}

+ (instancetype)reachabilityWithHostName:(NSString *)hostName
{
Reachability* returnValue = NULL;
OIMReachability* returnValue = NULL;
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]);
if (reachability != NULL)
{
Expand All @@ -90,7 +90,7 @@ + (instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress
{
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, hostAddress);

Reachability* returnValue = NULL;
OIMReachability* returnValue = NULL;

if (reachability != NULL)
{
Expand Down

0 comments on commit d3cc2d1

Please sign in to comment.