heavyrain2012 4 years ago
parent
commit
03434e8f94

+ 0 - 17
wfclient/WFChatClient/Client/WFCCNetworkService.mm

@@ -103,12 +103,6 @@ public:
             [m_delegate onDeleteMessage:messageUid];
         }
     }
-    id<ReceiveMessageDelegate> m_delegate;
-};
-
-class MDCB : public mars::stn::MessageDeliveredCallback {
-public:
-    MDCB(id<ReceiveMessageDelegate> delegate) : m_delegate(delegate) {}
     
     void onUserReceivedMessage(const std::map<std::string, int64_t> &userReceived) {
         if (m_delegate && !userReceived.empty()) {
@@ -117,13 +111,6 @@ public:
         }
     }
     
-    id<ReceiveMessageDelegate> m_delegate;
-};
-
-class MRCB : public mars::stn::MessageReadedCallback {
-public:
-    MRCB(id<ReceiveMessageDelegate> delegate) : m_delegate(delegate) {}
-    
     void onUserReadedMessage(const std::list<mars::stn::TReadEntry> &userReceived) {
         if (m_delegate && !userReceived.empty()) {
             NSMutableArray *ds = convertProtoReadedList(userReceived);
@@ -134,8 +121,6 @@ public:
     id<ReceiveMessageDelegate> m_delegate;
 };
 
-
-
 WFCCUserInfo* convertUserInfo(const mars::stn::TUserInfo &tui) {
     WFCCUserInfo *userInfo = [[WFCCUserInfo alloc] init];
     userInfo.userId = [NSString stringWithUTF8String:tui.uid.c_str()];
@@ -646,8 +631,6 @@ static WFCCNetworkService * sharedSingleton = nil;
   mars::stn::setRefreshFriendListCallback(new GFLCB(self));
     mars::stn::setRefreshFriendRequestCallback(new GFRCB(self));
   mars::stn::setRefreshSettingCallback(new GSCB(self));
-  mars::stn::setMessageDeliveredCallback(new MDCB(self));
-  mars::stn::setMessageReadedCallback(new MRCB(self));
   mars::baseevent::OnCreate();
 }
 - (BOOL)connect:(NSString *)host {

+ 18 - 32
wfclient/WFChatClient/Proto/mars.framework/Headers/proto/proto.h

@@ -449,18 +449,18 @@ namespace mars{
         };
     
         class TReadEntry : public TSerializable {
-                public:
-                    TReadEntry() : conversationType(0), line(0), readDt(0) {}
-                    std::string userId;
-                    int conversationType;
-                    std::string target;
-                    int line;
-                    int64_t readDt;
-                    virtual ~TReadEntry(){}
-        #if WFCHAT_PROTO_SERIALIZABLE
-                    virtual void Serialize(void *writer) const;
-                    virtual void Unserialize(const Value& value);
-        #endif //WFCHAT_PROTO_SERIALIZABLE
+        public:
+            TReadEntry() : conversationType(0), line(0), readDt(0) {}
+            std::string userId;
+            int conversationType;
+            std::string target;
+            int line;
+            int64_t readDt;
+            virtual ~TReadEntry(){}
+#if WFCHAT_PROTO_SERIALIZABLE
+            virtual void Serialize(void *writer) const;
+            virtual void Unserialize(const Value& value);
+#endif //WFCHAT_PROTO_SERIALIZABLE
         };
     
         class TDeliveryEntry : public TSerializable {
@@ -615,17 +615,6 @@ namespace mars{
         virtual ~GetSettingCallback() {}
       };
     
-    class MessageDeliveredCallback {
-    public:
-      virtual void onUserReceivedMessage(const std::map<std::string, int64_t> &userReceived) = 0;
-      virtual ~MessageDeliveredCallback() {}
-    };
-    
-    class MessageReadedCallback {
-    public:
-      virtual void onUserReadedMessage(const std::list<TReadEntry> &userReceived) = 0;
-      virtual ~MessageReadedCallback() {}
-    };
     
         enum ConnectionStatus {
             kConnectionStatusSecretKeyMismatch = -6,
@@ -651,6 +640,8 @@ namespace mars{
             virtual void onReceiveMessage(const std::list<TMessage> &messageList, bool hasMore) = 0;
             virtual void onRecallMessage(const std::string operatorId, long long messageUid) = 0;
             virtual void onDeleteMessage(long long messageUid) = 0;
+            virtual void onUserReceivedMessage(const std::map<std::string, int64_t> &userReceived) = 0;
+            virtual void onUserReadedMessage(const std::list<TReadEntry> &userReceived) = 0;
         };
 
         extern bool setAuthInfo(const std::string &userId, const std::string &token);
@@ -660,11 +651,6 @@ namespace mars{
         extern void setConnectionStatusCallback(ConnectionStatusCallback *callback);
         extern void setReceiveMessageCallback(ReceiveMessageCallback *callback);
     
-        extern void setMessageDeliveredCallback(MessageDeliveredCallback *callback);
-        extern void setMessageReadedCallback(MessageReadedCallback *callback);
-    
-    
-    
         extern void setDNSResult(std::vector<std::string> serverIPs);
         extern void setRefreshUserInfoCallback(GetUserInfoCallback *callback);
         extern void setRefreshGroupInfoCallback(GetGroupInfoCallback *callback);
@@ -771,12 +757,12 @@ namespace mars{
         extern bool IsCommercialServer();
 
         extern bool filesystem_exists(const std::string &path);
-		extern bool filesystem_create_directories(const std::string &path);
+        extern bool filesystem_create_directories(const std::string &path);
         extern bool filesystem_copy_file(const std::string &source, const std::string &dest, bool overwrite);
-		extern bool filesystem_copy_files(const std::string &source, const std::string &dest);
+        extern bool filesystem_copy_files(const std::string &source, const std::string &dest);
         extern bool filesystem_remove(const std::string &path);
-		extern void filesystem_copy_directory(const std::string &strSourceDir, const std::string &strDestDir);
-		
+        extern void filesystem_copy_directory(const std::string &strSourceDir, const std::string &strDestDir);
+        
     }
 }