You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
7.0 KiB

//
// JCMessageChannel.h
// JCSDKOC
//
// Created by maikireton on 2017/8/11.
// Copyright © 2017年 juphoon. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JCMessageChannelItem.h"
#import "JCMessageChannelCallback.h"
/**
* @defgroup
* @{
*
*/
/**
*
*/
@interface JCMessageChannel : NSObject
/**
*
*
*
*/
@property (nonatomic, copy) NSString * __nonnull thumbDir;
/**
* JCMessageChannel
*
* JCMessageChannel 线
*
* @note
* - JCMessageChannel {@link destroy} JCMessageChannel
* - JCClient @ref JCClient.state "state" @ref JCClientStateNotInit
*
* @param client JCClient
* @param callback JCMessageChannelCallback
* @return JCMessageChannel
* @exception "JCClient、JCMessageChannelCallback 任意一个参数传空就会出现调用异常"
*/
+(JCMessageChannel* __nullable)create:(JCClient* __nonnull)client callback:(id<JCMessageChannelCallback> __nonnull)callback;
/**
* JCMessageChannel
*
* JCMessageChannel 使 JCMessageChannel <br>
* **** JCSDK JCMessageChannel <br>
* JCMessageChannel @ref destroy
*/
+(void)destroy;
/**
*
*
* @note 10KB
*
* @param type :
* - @ref JCMessageChannelType1To1 :
* - @ref JCMessageChannelTypeGroup :
* @param keyId :
* - type @ref JCMessageChannelType1To1 serverUid
* - type @ref JCMessageChannelTypeGroup serverUid
* @param messageType textxml等
* @param text
* @param extraParams
* @param cookie
* @param atAll @
* @param atServerUidList "@"serverUid列表
* @return
* - JCMessageChannelItem {@link JCMessageChannelCallback#onMessageSendUpdate: onMessageSendUpdate}
* - null
*/
-(JCMessageChannelItem* __nullable)sendMessage:(JCMessageChannelType)type keyId:(NSString* __nonnull)keyId messageType:(NSString* __nonnull)messageType text:(NSString* __nonnull)text extraParams:(NSDictionary* __nullable)extraParams cookie:(id __nullable)cookie atAll:(bool)atAll atServerUidList:(NSArray<NSString*>* __nullable)atServerUidList;
/**
*
*
* @param type
* - @ref JCMessageChannelType1To1 :
* - @ref JCMessageChannelTypeGroup :
* @param keyId
* - type @ref JCMessageChannelType1To1 serverUid
* - type @ref JCMessageChannelTypeGroup serverUid
* @param messageType imagevideo等
* @param fileUri
* @param thumbUri
* @param size ()
* @param duration
* @param extraParams
* @param cookie
* @param atAll @
* @param atUidList "@"serverUid列表
* @return
* - JCMessageChannelItem {@link JCMessageChannelCallback#onMessageSendUpdate: onMessageSendUpdate}
* - null
*/
-(JCMessageChannelItem* __nullable)sendFile:(JCMessageChannelType)type keyId:(NSString* __nonnull)keyId messageType:(NSString* __nonnull)messageType fileUri:(NSString* __nonnull)fileUri thumbUri:(NSString* __nullable)thumbUri size:(int)size duration:(int)duration extraParams:(NSDictionary* __nullable)extraParams cookie:(id __nullable)cookie atAll:(bool)atAll atServerUidList:(NSArray<NSString*>* __nullable)atServerUidList;
/**
*
*
* @param serverUid @ref JCClient#serverUid "serverUid" @ref JCGroupItem#groupId "groupId" null返回全部
* @param lastQueryTime
* @return
* - >0id {@link JCMessageChannelCallback#onRefreshConversation:result:conversations:reason:updateTime:refreshServerUid: onRefreshConversation}
* - -1
*/
-(int)refreshConversation:(NSString* __nullable)serverUid lastQueryTime:(long)lastQueryTime;
/**
*
*
* @param serverUid serverUid serverUid
* @param startMessageId ID-1
* @param count
* @param pack
* @return
* - >0id {@link JCMessageChannelCallback#onFetchMessageResult:result:reason: onFetchMessageResult}
* - -1
*/
-(int)fetchMessages:(nonnull NSString*)serverUid startMessageId:(long)startMessageId count:(int)count pack:(bool)pack;
/**
*
*
* @param serverUid serverUid serverUid
* @param messageId ID-1
* @return
* - >0id {@link JCMessageChannelCallback#onMarkReadResult:result:reason: onMarkReadResult}
* - -1
*/
-(int)markReadMessage:(nonnull NSString*)serverUid messageId:(long)messageId isGroup:(bool)isGroup;
/**
*
*
* @param serverUid serverUid serverUid
* @param messageId ID-1
* @return
* - >0id {@link JCMessageChannelCallback#onMarkRecvResult:result:reason: onMarkRecvResult}
* - -1
*/
-(int)markRecvMessage:(nonnull NSString*)serverUid messageId:(long)messageId;
/**
*
*
* @param serverUid serverUid serverUid
* @param messageId ID
* @param content
* @return
* - >0id {@link JCMessageChannelCallback#onWithdrawalMessageResult:result:message:reason: onDrawBackMessageResult}
* - -1
*/
-(int)withdrawalMessage:(nonnull NSString*)serverUid messageId:(long)messageId content:(NSString* __nonnull)content;
@end
/**
* @}
*/