BGIMPrivateMsgHandler.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. //
  2. // BGIMPrivateMsgHandler.h
  3. // BuguLive
  4. //
  5. // Created by 朱庆彬 on 2017/8/2.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "ConversationModel.h"
  9. #import "GiftModel.h"
  10. #import "dataModel.h"
  11. #import <Foundation/Foundation.h>
  12. #import "AudioChatEnum.h"
  13. extern NSString *g_notif_chatmsg;
  14. @class BGIMPrivateMsgHandler;
  15. @protocol FWIMPrivateMsgHandlerDelegate <NSObject>
  16. @end
  17. @interface BGIMPrivateMsgHandler : NSObject
  18. BogoSingletonH(Instance);
  19. @property (nonatomic, weak) id<FWIMPrivateMsgHandlerDelegate> delegate;
  20. @end
  21. @interface SIMMsgObj : ConversationModel
  22. @property (nonatomic, strong) V2TIMMessage *mCoreTMsg;
  23. @property (nonatomic, assign) int mSenderId; //发送者的用户ID
  24. @property (nonatomic, assign) BOOL is_robot;
  25. //是不是私聊的消息,如果是返回YES,并且发送一个通知出去,聊天界面自己接收该通知,
  26. + (BOOL)maybeIMChatMsg:(V2TIMMessage *)itmsg;
  27. + (NSString *)makeMsgDesc:(SIMMsgObj *)msg;
  28. + (NSString *)makeMsgDescv2:(SIMMsgObj *)msg;
  29. + (BOOL)saveData:(id)data forkey:(NSString *)key;
  30. @end
  31. @interface SFriendObj : SAutoEx
  32. - (id)initWithUserId:(int)userid;
  33. @property (nonatomic, assign) int mUser_id;
  34. @property (nonatomic, strong) NSString *mNick_name;
  35. @property (nonatomic, strong) NSString *mHead_image;
  36. @property (nonatomic, assign) int mUser_level; //等级
  37. @property (nonatomic, strong) NSString *mV_icon; //等级ICON
  38. @property (nonatomic, assign) int mSex;
  39. @property (nonatomic, assign) BOOL is_robot;
  40. @property (nonatomic, strong) NSString *mLastMsg;
  41. @property (nonatomic, strong) NSDate *mLastMsgDate;
  42. @property(nonatomic, strong) NSString *unread_count;
  43. - (void)setLMsg:(TIMMessage *)msg;
  44. - (NSString *)getTimeStr;
  45. //获取未读消息
  46. - (int)getUnReadCount;
  47. //忽略这个未读
  48. - (void)ignoreThisUnReadCount;
  49. //删除会话
  50. - (void)delThis:(void (^)(SResBase *resb))block;
  51. //获取消息 before = YES 获取 posmsg 之前的消息,否则之后的消息 posmsg == nil 就是最新的消息
  52. - (void)getMsgList:(BOOL)before posmsg:(SIMMsgObj *)posmsg block:(void (^)(SResBase *resb, NSArray *all))block;
  53. //发送文字消息
  54. - (SIMMsgObj *)sendTextMsg:(NSString *)text block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  55. //发送图片消息
  56. - (SIMMsgObj *)sendPicMsg:(UIImage *)img block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  57. /** 语音通话消息 */
  58. - (SIMMsgObj *)sendCustomCallAudioTextMsg:(NSString *)text callAudioType:(AudioChatType)callAudioType isCall:(BOOL)isCall block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  59. - (SIMMsgObj *)sendCustomCallAudioTextMsgWithPush:(NSString *)text callAudioType:(AudioChatType)callAudioType isCall:(BOOL)isCall block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  60. - (SIMMsgObj *)sendCustomCallVideoTextMsg:(NSString *)text callAudioType:(AudioChatType)callAudioType isCall:(BOOL)isCall block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  61. - (SIMMsgObj *)sendCustomCallVideoTextMsgWithPush:(NSString *)text callAudioType:(AudioChatType)callAudioType isCall:(BOOL)isCall block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  62. //发送礼物消息
  63. - (SIMMsgObj *)sendVoiceMsg:(NSURL *)voicepath duration:(NSTimeInterval)duration block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  64. //重发消息
  65. - (void)reSendMsg:(SIMMsgObj *)resmsg block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  66. //忽略未读
  67. + (void)ignoreMsg:(NSArray *)allFriends block:(void (^)(SResBase *resb))block;
  68. //获取我的列表,,消息的列表
  69. + (void)getMyFriendMsgList:(int)bFollowed lastObj:(SFriendObj *)lastObj block:(void (^)(SResBase *resb, NSArray *all, int unReadNum))block;
  70. //发送礼物
  71. - (void)sendGiftMsg:(GiftModel *)findgifobj block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  72. //赠送游戏币
  73. - (void)sendCoinMsgWithCoin:(NSString *)coin block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  74. - (void)sendDiamondsMsgWithDiamonds:(NSString *)diamonds block:(void (^)(SResBase *resb, SIMMsgObj *thatmsg))block;
  75. //有多少未读消息
  76. //+ (int)getAllUnReadCount;
  77. + (void)getAllUnReadCountComplete:(void (^)(int num))block;
  78. //获取 好友/未关注的 未读消息数目
  79. + (void)getMyFocusFriendUnReadMsgNumIsFriend:(int)isFriend block:(void (^)(int unReadNum))block;
  80. + (NSString *)makepicsavepath;
  81. + (NSString *)makevoicesavepath:(NSString *)filename;
  82. + (NSString *)makevoicefilename;
  83. @end