From 2dd8e79a88b683dd6314474bd4caf856464ce20b Mon Sep 17 00:00:00 2001 From: wu736139669 Date: Fri, 26 Jun 2015 11:20:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ash_AWord.xcodeproj/project.pbxproj | 30 + .../xcdebugger/Breakpoints_v2.xcbkptlist | 674 ++++++++++++------ Ash_AWord/AppDelegate.m | 8 +- Ash_AWord/Config/Common.h | 6 +- .../Resource/en.lproj/Localizable.strings | 2 +- .../zh-Hans.lproj/Localizable.strings | 2 + Ash_AWord/Utility/Network/RequireEngine.m | 2 - Ash_AWord/Utility/Tool/Ash_UIUtil.m | 5 + .../Chat/Call/CallViewController.h | 2 +- .../Chat/Call/CallViewController.m | 27 +- .../Chat/ChatMainViewController.m | 48 +- .../ViewControllers/Main/MainViewController.h | 1 + .../ViewControllers/Main/MainViewController.m | 30 +- .../ViewControllers/Main/MyViewController.m | 40 +- .../ViewControllers/Main/NoteViewController.m | 2 +- .../My/MessageListViewController.h | 14 + .../My/MessageListViewController.m | 176 +++++ .../My/MessageListViewController.xib | 34 + .../ViewControllers/My/SetUpViewController.m | 5 +- Ash_AWord/ViewModels/Common/UserViewModel.h | 3 + Ash_AWord/ViewModels/Common/UserViewModel.m | 23 + .../Views/Common/MyMessageTableViewCell.h | 15 + .../Views/Common/MyMessageTableViewCell.m | 33 + .../Views/Common/MyMessageTableViewCell.xib | 42 ++ .../Views/Message/MessageTableViewCell.m | 2 +- Ash_AWord/Views/Note/NoteTableViewCell.m | 2 +- .../Views/User/MessageListTableViewCell.h | 21 + .../Views/User/MessageListTableViewCell.m | 100 +++ .../Views/User/MessageListTableViewCell.xib | 93 +++ 29 files changed, 1167 insertions(+), 275 deletions(-) create mode 100644 Ash_AWord/ViewControllers/My/MessageListViewController.h create mode 100644 Ash_AWord/ViewControllers/My/MessageListViewController.m create mode 100644 Ash_AWord/ViewControllers/My/MessageListViewController.xib create mode 100644 Ash_AWord/Views/Common/MyMessageTableViewCell.h create mode 100644 Ash_AWord/Views/Common/MyMessageTableViewCell.m create mode 100644 Ash_AWord/Views/Common/MyMessageTableViewCell.xib create mode 100644 Ash_AWord/Views/User/MessageListTableViewCell.h create mode 100644 Ash_AWord/Views/User/MessageListTableViewCell.m create mode 100644 Ash_AWord/Views/User/MessageListTableViewCell.xib diff --git a/Ash_AWord.xcodeproj/project.pbxproj b/Ash_AWord.xcodeproj/project.pbxproj index 7792d98..5ae530a 100644 --- a/Ash_AWord.xcodeproj/project.pbxproj +++ b/Ash_AWord.xcodeproj/project.pbxproj @@ -229,6 +229,10 @@ A97C55061AC933AD0038818A /* UMSnsAccountViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97C54FA1AC933AD0038818A /* UMSnsAccountViewController.xib */; }; A97C55071AC933AD0038818A /* UMSShareListController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97C54FB1AC933AD0038818A /* UMSShareListController.xib */; }; A97C55081AC933AD0038818A /* UMSocialSDKResourcesNew.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A97C54FC1AC933AD0038818A /* UMSocialSDKResourcesNew.bundle */; }; + A97CCE291B3BE6440046FE17 /* MessageListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A97CCE271B3BE6440046FE17 /* MessageListViewController.m */; }; + A97CCE2A1B3BE6440046FE17 /* MessageListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97CCE281B3BE6440046FE17 /* MessageListViewController.xib */; }; + A97CCE2E1B3BEBDA0046FE17 /* MessageListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A97CCE2C1B3BEBDA0046FE17 /* MessageListTableViewCell.m */; }; + A97CCE2F1B3BEBDA0046FE17 /* MessageListTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97CCE2D1B3BEBDA0046FE17 /* MessageListTableViewCell.xib */; }; A97DBE331ACAE10800705682 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A97DBE311ACAE10800705682 /* LoginViewController.m */; }; A97DBE341ACAE10800705682 /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE321ACAE10800705682 /* LoginViewController.xib */; }; A97DBE3F1ACAE29E00705682 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = A97DBE391ACAE29E00705682 /* Icon.png */; }; @@ -293,6 +297,8 @@ A9B6DFE41B202E950003C1BC /* night_user_comment_circle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9B6DFE31B202E950003C1BC /* night_user_comment_circle@2x.png */; }; A9B6DFE61B2033A80003C1BC /* toolbar_light_comment@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9B6DFE51B2033A80003C1BC /* toolbar_light_comment@2x.png */; }; A9B6DFEC1B2068790003C1BC /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A9B6DFEE1B2068790003C1BC /* Localizable.strings */; }; + A9B7BD791B3C083E00C0B1D7 /* MyMessageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B7BD771B3C083E00C0B1D7 /* MyMessageTableViewCell.m */; }; + A9B7BD7A1B3C083E00C0B1D7 /* MyMessageTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9B7BD781B3C083E00C0B1D7 /* MyMessageTableViewCell.xib */; }; A9B8FEC51B32A4CF00619C7D /* ChatMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B8FEC31B32A4CF00619C7D /* ChatMainViewController.m */; }; A9B8FEC61B32A4CF00619C7D /* ChatMainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9B8FEC41B32A4CF00619C7D /* ChatMainViewController.xib */; }; A9B8FEC91B32AC7000619C7D /* DXMessageToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B8FEC81B32AC7000619C7D /* DXMessageToolBar.m */; }; @@ -819,6 +825,12 @@ A97C54FB1AC933AD0038818A /* UMSShareListController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UMSShareListController.xib; sourceTree = ""; }; A97C54FC1AC933AD0038818A /* UMSocialSDKResourcesNew.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = UMSocialSDKResourcesNew.bundle; sourceTree = ""; }; A97C54FD1AC933AD0038818A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/UMSocialLocalizable.strings"; sourceTree = ""; }; + A97CCE261B3BE6440046FE17 /* MessageListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageListViewController.h; sourceTree = ""; }; + A97CCE271B3BE6440046FE17 /* MessageListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageListViewController.m; sourceTree = ""; }; + A97CCE281B3BE6440046FE17 /* MessageListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessageListViewController.xib; sourceTree = ""; }; + A97CCE2B1B3BEBDA0046FE17 /* MessageListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageListTableViewCell.h; sourceTree = ""; }; + A97CCE2C1B3BEBDA0046FE17 /* MessageListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageListTableViewCell.m; sourceTree = ""; }; + A97CCE2D1B3BEBDA0046FE17 /* MessageListTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessageListTableViewCell.xib; sourceTree = ""; }; A97DBE301ACAE10800705682 /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = ""; }; A97DBE311ACAE10800705682 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = ""; }; A97DBE321ACAE10800705682 /* LoginViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LoginViewController.xib; sourceTree = ""; }; @@ -905,6 +917,9 @@ A9B6DFE51B2033A80003C1BC /* toolbar_light_comment@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "toolbar_light_comment@2x.png"; sourceTree = ""; }; A9B6DFED1B2068790003C1BC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; A9B6DFEF1B20687B0003C1BC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + A9B7BD761B3C083E00C0B1D7 /* MyMessageTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyMessageTableViewCell.h; sourceTree = ""; }; + A9B7BD771B3C083E00C0B1D7 /* MyMessageTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyMessageTableViewCell.m; sourceTree = ""; }; + A9B7BD781B3C083E00C0B1D7 /* MyMessageTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MyMessageTableViewCell.xib; sourceTree = ""; }; A9B8FEBB1B32930100619C7D /* libEaseMobClientSDKLite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libEaseMobClientSDKLite.a; sourceTree = ""; }; A9B8FEC21B32A4CF00619C7D /* ChatMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatMainViewController.h; sourceTree = ""; }; A9B8FEC31B32A4CF00619C7D /* ChatMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatMainViewController.m; sourceTree = ""; }; @@ -1202,6 +1217,9 @@ A9B4A9511AEDC3620017C655 /* FeedbackViewController.h */, A9B4A9521AEDC3620017C655 /* FeedbackViewController.m */, A9B4A9531AEDC3620017C655 /* FeedbackViewController.xib */, + A97CCE261B3BE6440046FE17 /* MessageListViewController.h */, + A97CCE271B3BE6440046FE17 /* MessageListViewController.m */, + A97CCE281B3BE6440046FE17 /* MessageListViewController.xib */, ); path = My; sourceTree = ""; @@ -1323,6 +1341,9 @@ A9A3A74C1B2805DA001AAB3A /* PersonalTopView.h */, A9A3A74D1B2805DA001AAB3A /* PersonalTopView.m */, A9A3A74F1B2805EA001AAB3A /* PersonalTopView.xib */, + A97CCE2B1B3BEBDA0046FE17 /* MessageListTableViewCell.h */, + A97CCE2C1B3BEBDA0046FE17 /* MessageListTableViewCell.m */, + A97CCE2D1B3BEBDA0046FE17 /* MessageListTableViewCell.xib */, ); path = User; sourceTree = ""; @@ -2330,6 +2351,9 @@ A9B6DFCA1B1FFDB20003C1BC /* CommentTextView.h */, A9B6DFCB1B1FFDB20003C1BC /* CommentTextView.m */, A9B6DFD11B20054B0003C1BC /* CommentTextView.xib */, + A9B7BD761B3C083E00C0B1D7 /* MyMessageTableViewCell.h */, + A9B7BD771B3C083E00C0B1D7 /* MyMessageTableViewCell.m */, + A9B7BD781B3C083E00C0B1D7 /* MyMessageTableViewCell.xib */, ); path = Common; sourceTree = ""; @@ -2571,6 +2595,7 @@ A971EDF31B32B7AF0023740E /* chatBar_more_locationSelected@2x.png in Resources */, A971EDF41B32B7AF0023740E /* chatBar_more_photo@2x.png in Resources */, A971EE0A1B32B7C40023740E /* chatBar_colorMore_video@2x.png in Resources */, + A9B7BD7A1B3C083E00C0B1D7 /* MyMessageTableViewCell.xib in Resources */, A99AA12F1ADD028400574B12 /* Icon120.png in Resources */, A98536821AEBC7BB000312BF /* SetUserInfoViewController.xib in Resources */, A9C58DED1B3AA8EC0007FCDC /* VoiceSearchFeedback004.png in Resources */, @@ -2675,6 +2700,7 @@ A971EDF21B32B7AF0023740E /* chatBar_more_location@2x.png in Resources */, A9FD82BD1B1D544300AC4DC9 /* CommentTableViewCell.xib in Resources */, A971EE091B32B7C40023740E /* chatBar_colorMore_photoSelected@2x.png in Resources */, + A97CCE2A1B3BE6440046FE17 /* MessageListViewController.xib in Resources */, A9C58DE31B3AA8EC0007FCDC /* chatFire_audioPlaying2.png in Resources */, A98536731AEB66F9000312BF /* ReportViewController.xib in Resources */, A9C58DF61B3AA8EC0007FCDC /* VoiceSearchFeedback008@2x.png in Resources */, @@ -2709,6 +2735,7 @@ A93441E51ACA8AC400A6B233 /* Profile_filter_contentIcon@2x.png in Resources */, A971EDF11B32B7AF0023740E /* chatBar_more_cameraSelected@2x.png in Resources */, A97559B31ACBC683004ADA42 /* NotePublishViewController.xib in Resources */, + A97CCE2F1B3BEBDA0046FE17 /* MessageListTableViewCell.xib in Resources */, A966FB991AD62CAE00542068 /* checkmark@2x.png in Resources */, A9C58E0C1B3AA8EC0007FCDC /* VoiceSearchFeedback019@2x.png in Resources */, A978CB401B3A3D7100028C4A /* chat_location_detail_disclosure@2x.png in Resources */, @@ -2841,6 +2868,7 @@ A9F917D31B3906150007A3AC /* MessageModelManager.m in Sources */, A9754A1D1ADC080E0018BAAD /* AutoRecoveringHttpDataSource.m in Sources */, A971EDB61B32B5740023740E /* EMCDDeviceManager+Remind.m in Sources */, + A97CCE2E1B3BEBDA0046FE17 /* MessageListTableViewCell.m in Sources */, A97C54CD1AC8F10F0038818A /* BaseViewModel.m in Sources */, A9754A261ADC199B0018BAAD /* MyMessageViewController.m in Sources */, A9617A4F1ACC0D0F0024AE4A /* NoteViewModel.m in Sources */, @@ -2872,6 +2900,7 @@ A97C54D01AC8F10F0038818A /* PropertyEntity.m in Sources */, A96F27F91B21C5C800DA0A66 /* PraiseUserListViewController.m in Sources */, A93441DE1ACA311700A6B233 /* Ash_UIUtil.m in Sources */, + A9B7BD791B3C083E00C0B1D7 /* MyMessageTableViewCell.m in Sources */, A9B8FEC91B32AC7000619C7D /* DXMessageToolBar.m in Sources */, A968624C1ACCF0B400DDAA6B /* README.md in Sources */, A9754A1E1ADC080E0018BAAD /* CoreFoundationDataSource.m in Sources */, @@ -2906,6 +2935,7 @@ A96862431ACCF0B400DDAA6B /* MWCaptionView.m in Sources */, A9F7F45F1B33BC4E00317F3E /* CallViewController.m in Sources */, A971EDCA1B32B6A40023740E /* EMVoiceConverter.mm in Sources */, + A97CCE291B3BE6440046FE17 /* MessageListViewController.m in Sources */, A9FD82BC1B1D544300AC4DC9 /* CommentTableViewCell.m in Sources */, A9B6DFCC1B1FFDB20003C1BC /* CommentTextView.m in Sources */, A96F27EE1B2195BA00DA0A66 /* UIImageView+Reloading.m in Sources */, diff --git a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 56b2360..ee18f87 100644 --- a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -10,11 +10,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/AppDelegate.m" - timestampString = "456899920.303763" + timestampString = "456981488.027195" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "167" - endingLineNumber = "167" + startingLineNumber = "173" + endingLineNumber = "173" landmarkName = "+visibleViewController" landmarkType = "5"> @@ -26,11 +26,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/AppDelegate.m" - timestampString = "456899920.303763" + timestampString = "456981488.027195" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "94" - endingLineNumber = "94" + startingLineNumber = "100" + endingLineNumber = "100" landmarkName = "-applicationDidBecomeActive:" landmarkType = "5"> @@ -42,11 +42,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/AppDelegate.m" - timestampString = "456899920.303763" + timestampString = "456981488.027195" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "138" - endingLineNumber = "138" + startingLineNumber = "144" + endingLineNumber = "144" landmarkName = "-application:handleOpenURL:" landmarkType = "5"> @@ -1157,7 +1157,7 @@ @@ -2553,11 +2553,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewModels/Common/UserViewModel.m" - timestampString = "456201387.947592" + timestampString = "456977574.6133" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "24" - endingLineNumber = "24" + startingLineNumber = "25" + endingLineNumber = "25" landmarkName = "+JSONKeyPathsByPropertyKey" landmarkType = "5"> @@ -2569,11 +2569,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewModels/Common/UserViewModel.m" - timestampString = "456201588.71059" + timestampString = "456977574.6133" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "30" - endingLineNumber = "30" + startingLineNumber = "31" + endingLineNumber = "31" landmarkName = "-initWithDictionary:error:" landmarkType = "5"> @@ -2649,11 +2649,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456840750.267307" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "167" - endingLineNumber = "167" + startingLineNumber = "158" + endingLineNumber = "158" landmarkName = "-didSendText:" landmarkType = "5"> @@ -2729,11 +2729,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456840750.267307" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "292" - endingLineNumber = "292" + startingLineNumber = "283" + endingLineNumber = "283" landmarkName = "-moreViewPhotoAction:" landmarkType = "5"> @@ -2757,15 +2757,15 @@ @@ -2793,7 +2793,7 @@ moduleName = "Ash_AWord" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456899059.781331" + timestampString = "456977650.003048" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "18" @@ -2808,7 +2808,7 @@ moduleName = "Ash_AWord" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456899059.781483" + timestampString = "456977650.003204" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "18" @@ -2821,7 +2821,7 @@ @@ -2857,11 +2857,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "644" - endingLineNumber = "644" + startingLineNumber = "636" + endingLineNumber = "636" landmarkName = "-reloadTableViewDataWithMessage:" landmarkType = "5"> @@ -2889,11 +2889,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "646" - endingLineNumber = "646" + startingLineNumber = "638" + endingLineNumber = "638" landmarkName = "-reloadTableViewDataWithMessage:" landmarkType = "5"> @@ -2905,11 +2905,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "645" - endingLineNumber = "645" + startingLineNumber = "637" + endingLineNumber = "637" landmarkName = "-reloadTableViewDataWithMessage:" landmarkType = "5"> @@ -2921,11 +2921,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "661" - endingLineNumber = "661" + startingLineNumber = "653" + endingLineNumber = "653" landmarkName = "-didReceiveMessage:" landmarkType = "5"> @@ -2937,11 +2937,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "720" - endingLineNumber = "720" + startingLineNumber = "712" + endingLineNumber = "712" landmarkName = "-formatMessages:" landmarkType = "5"> @@ -2985,11 +2985,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "790" - endingLineNumber = "790" + startingLineNumber = "782" + endingLineNumber = "782" landmarkName = "-didFetchingMessageAttachments:progress:" landmarkType = "5"> @@ -3029,7 +3029,7 @@ @@ -3065,11 +3065,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "799" - endingLineNumber = "799" + startingLineNumber = "791" + endingLineNumber = "791" landmarkName = "-loadMoreMessages" landmarkType = "5"> @@ -3081,11 +3081,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "693" - endingLineNumber = "693" + startingLineNumber = "685" + endingLineNumber = "685" landmarkName = "-formatMessages:" landmarkType = "5"> @@ -3129,11 +3129,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "696" - endingLineNumber = "696" + startingLineNumber = "688" + endingLineNumber = "688" landmarkName = "-formatMessages:" landmarkType = "5"> @@ -3177,11 +3177,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/AppDelegate.m" - timestampString = "456899920.303763" + timestampString = "456981488.027195" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "109" - endingLineNumber = "109" + startingLineNumber = "115" + endingLineNumber = "115" landmarkName = "-application:didFailToRegisterForRemoteNotificationsWithError:" landmarkType = "5"> @@ -3189,7 +3189,7 @@ @@ -3273,11 +3273,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "651" - endingLineNumber = "651" + startingLineNumber = "643" + endingLineNumber = "643" landmarkName = "-didReceiveMessage:" landmarkType = "5"> @@ -3289,11 +3289,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "667" - endingLineNumber = "667" + startingLineNumber = "659" + endingLineNumber = "659" landmarkName = "-didReceiveMessageId:chatter:error:" landmarkType = "5"> @@ -3301,15 +3301,15 @@ @@ -3321,11 +3321,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/Call/CallViewController.m" - timestampString = "456847238.510072" + timestampString = "456931229.064012" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "509" - endingLineNumber = "509" + startingLineNumber = "518" + endingLineNumber = "518" landmarkName = "-callSessionStatusChanged:changeReason:error:" landmarkType = "5"> @@ -3337,11 +3337,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456908127.054225" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "538" - endingLineNumber = "538" + startingLineNumber = "542" + endingLineNumber = "542" landmarkName = "-didReceiveLocalNotification:" landmarkType = "5"> @@ -3353,11 +3353,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "662" - endingLineNumber = "662" + startingLineNumber = "654" + endingLineNumber = "654" landmarkName = "-didReceiveMessage:" landmarkType = "5"> @@ -3369,11 +3369,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456898163.370652" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "663" - endingLineNumber = "663" + startingLineNumber = "655" + endingLineNumber = "655" landmarkName = "-didReceiveMessageId:chatter:error:" landmarkType = "5"> @@ -3381,15 +3381,15 @@ @@ -3401,11 +3401,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "235" - endingLineNumber = "235" + startingLineNumber = "239" + endingLineNumber = "239" landmarkName = "-didReceiveMessage:" landmarkType = "5"> @@ -3417,11 +3417,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "241" - endingLineNumber = "241" + startingLineNumber = "245" + endingLineNumber = "245" landmarkName = "-didReceiveMessage:" landmarkType = "5"> @@ -3433,11 +3433,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "243" - endingLineNumber = "243" + startingLineNumber = "247" + endingLineNumber = "247" landmarkName = "-didReceiveMessage:" landmarkType = "5"> @@ -3449,11 +3449,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "255" - endingLineNumber = "255" + startingLineNumber = "259" + endingLineNumber = "259" landmarkName = "-playSoundAndVibration" landmarkType = "5"> @@ -3465,11 +3465,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "279" - endingLineNumber = "279" + startingLineNumber = "283" + endingLineNumber = "283" landmarkName = "-showNotificationWithMessage:" landmarkType = "5"> @@ -3481,11 +3481,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "317" - endingLineNumber = "317" + startingLineNumber = "321" + endingLineNumber = "321" landmarkName = "-showNotificationWithMessage:" landmarkType = "5"> @@ -3497,11 +3497,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "362" - endingLineNumber = "362" + startingLineNumber = "366" + endingLineNumber = "366" landmarkName = "-showNotificationWithMessage:" landmarkType = "5"> @@ -3513,11 +3513,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "364" - endingLineNumber = "364" + startingLineNumber = "368" + endingLineNumber = "368" landmarkName = "-showNotificationWithMessage:" landmarkType = "5"> @@ -3529,11 +3529,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456896525.223919" + timestampString = "456981026.671824" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "33" - endingLineNumber = "33" + startingLineNumber = "35" + endingLineNumber = "35" landmarkName = "+loginWithUserName:" landmarkType = "5"> @@ -3545,11 +3545,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456896869.917864" + timestampString = "456981026.671824" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "30" - endingLineNumber = "30" + startingLineNumber = "32" + endingLineNumber = "32" landmarkName = "+loginWithUserName:" landmarkType = "5"> @@ -3561,7 +3561,7 @@ moduleName = "Ash_AWord" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456897895.11347" + timestampString = "456977650.012648" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "30" @@ -3576,7 +3576,7 @@ moduleName = "Ash_AWord" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456897895.113709" + timestampString = "456977650.012807" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "30" @@ -3593,11 +3593,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456896965.060197" + timestampString = "456981026.671824" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "36" - endingLineNumber = "36" + startingLineNumber = "40" + endingLineNumber = "40" landmarkName = "+loginWithUserName:" landmarkType = "5"> @@ -3609,11 +3609,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "359" - endingLineNumber = "359" + startingLineNumber = "363" + endingLineNumber = "363" landmarkName = "-showNotificationWithMessage:" landmarkType = "5"> @@ -3625,11 +3625,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "356" - endingLineNumber = "356" + startingLineNumber = "360" + endingLineNumber = "360" landmarkName = "-showNotificationWithMessage:" landmarkType = "5"> @@ -3641,11 +3641,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456900133.976826" + timestampString = "456933496.839326" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "153" - endingLineNumber = "153" + startingLineNumber = "154" + endingLineNumber = "154" landmarkName = "-setupUnreadMessageCount" landmarkType = "5"> @@ -3657,47 +3657,15 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456904456.659904" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "375" - endingLineNumber = "375" + startingLineNumber = "379" + endingLineNumber = "379" landmarkName = "-didLoginWithInfo:error:" landmarkType = "5"> - - - - - - - - @@ -3765,15 +3733,15 @@ @@ -3785,11 +3753,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456908127.054225" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "450" - endingLineNumber = "450" + startingLineNumber = "454" + endingLineNumber = "454" landmarkName = "-callSessionStatusChanged:changeReason:error:" landmarkType = "5"> @@ -3801,11 +3769,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456908127.054225" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "449" - endingLineNumber = "449" + startingLineNumber = "453" + endingLineNumber = "453" landmarkName = "-callSessionStatusChanged:changeReason:error:" landmarkType = "5"> @@ -3817,11 +3785,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456904298.07611" + timestampString = "456933977.786965" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "592" - endingLineNumber = "592" + startingLineNumber = "584" + endingLineNumber = "584" landmarkName = "-callSessionStatusChanged:changeReason:error:" landmarkType = "5"> @@ -3829,15 +3797,15 @@ @@ -3849,11 +3817,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456908127.054225" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "457" - endingLineNumber = "457" + startingLineNumber = "461" + endingLineNumber = "461" landmarkName = "-callOutWithChatter:" landmarkType = "5"> @@ -3865,14 +3833,302 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Main/MainViewController.m" - timestampString = "456908066.034125" + timestampString = "456933663.930822" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "442" - endingLineNumber = "442" + startingLineNumber = "446" + endingLineNumber = "446" landmarkName = "-callSessionStatusChanged:changeReason:error:" landmarkType = "5"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/AppDelegate.m b/Ash_AWord/AppDelegate.m index 6203e67..1152069 100644 --- a/Ash_AWord/AppDelegate.m +++ b/Ash_AWord/AppDelegate.m @@ -50,9 +50,15 @@ } #endif + NSString* apnsCertName = EaseMobApnsCertName_Dev; +#if DEBUG + apnsCertName = EaseMobApnsCertName_Dev; +#else + apnsCertName = EaseMobApnsCertNameProduct; +#endif //注册 APNS文件的名字, 需要与后台上传证书时的名字一一对应 - [[EaseMob sharedInstance] registerSDKWithAppKey:EaseMobAppKey apnsCertName:EaseMobApnsCertName]; + [[EaseMob sharedInstance] registerSDKWithAppKey:EaseMobAppKey apnsCertName:apnsCertName]; // 需要在注册sdk后写上该方法 [[EaseMob sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; diff --git a/Ash_AWord/Config/Common.h b/Ash_AWord/Config/Common.h index e0ce4b6..9a6ecdb 100644 --- a/Ash_AWord/Config/Common.h +++ b/Ash_AWord/Config/Common.h @@ -53,6 +53,8 @@ #define kLoginSuccessNotificationName @"kLoginSuccessNotificationName" #define kLogoutSuccessNotificationName @"kLogoutSuccessNotificationName" +#define kReceiveMessage @"kReceiveMessage" + //文字标签 #define kNetworkErrorTips @"网络连接失败" #define kSSoErrorTips @"授权失败,请重新授权" @@ -64,13 +66,15 @@ #define Ash_AWord_API_URL @"http://121.43.150.13/QuestionServer/rs/yjn/post" #define Ash_AWord_First_URL @"http://121.43.150.13" +#define Ash_AWord_Share_URL @"http://121.43.150.13/QuestionServer/web" //#define Ash_AWord_API_URL @"http://192.168.1.3:8080/QuestionServer" #define Sign_Key @"yjn@jjyy123" /** *环信信息 */ -#define EaseMobApnsCertName @"yujianni" +#define EaseMobApnsCertName_Dev @"yujianni" +#define EaseMobApnsCertNameProduct @"yujianni_product" #define EaseMobAppKey @"ash#ashyujianni" #define EasePassword @"123456" /** diff --git a/Ash_AWord/Resource/en.lproj/Localizable.strings b/Ash_AWord/Resource/en.lproj/Localizable.strings index 4fccf66..a0c9671 100644 --- a/Ash_AWord/Resource/en.lproj/Localizable.strings +++ b/Ash_AWord/Resource/en.lproj/Localizable.strings @@ -39,7 +39,7 @@ "message.startRecordFail" = "failure to start recording"; "message.noMessage" = "no messages"; - +"The other side is not online" = "The other side is not online"; //location "location.messageType" = "location message"; "location.fail" = "locate failure"; diff --git a/Ash_AWord/Resource/zh-Hans.lproj/Localizable.strings b/Ash_AWord/Resource/zh-Hans.lproj/Localizable.strings index 6ac0c87..8e45ab0 100644 --- a/Ash_AWord/Resource/zh-Hans.lproj/Localizable.strings +++ b/Ash_AWord/Resource/zh-Hans.lproj/Localizable.strings @@ -38,6 +38,8 @@ "message.startRecordFail" = "开始录音失败"; "message.noMessage" = "消息已经清空"; +"The other side is not online" = "对方不在线"; + "search" = "搜索"; "error" = "错误"; "delete" = "删除"; diff --git a/Ash_AWord/Utility/Network/RequireEngine.m b/Ash_AWord/Utility/Network/RequireEngine.m index 2f0c3cb..0dbc662 100644 --- a/Ash_AWord/Utility/Network/RequireEngine.m +++ b/Ash_AWord/Utility/Network/RequireEngine.m @@ -144,8 +144,6 @@ [self saveCacheWithAPIKey:apiKey property:proper data:tweet]; } failure:^(AFHTTPRequestOperation *__unused task, NSError *error) { - NSLog(@"%@", error.description); - if (failedBlock) { failedBlock(error); } diff --git a/Ash_AWord/Utility/Tool/Ash_UIUtil.m b/Ash_AWord/Utility/Tool/Ash_UIUtil.m index 655813f..aa05098 100644 --- a/Ash_AWord/Utility/Tool/Ash_UIUtil.m +++ b/Ash_AWord/Utility/Tool/Ash_UIUtil.m @@ -21,6 +21,8 @@ [self loginWithUserName:username]; }else if (error.errorCode == EMErrorServerDuplicatedAccount) { [self loginWithUserName:username]; + }else{ + [self loginWithUserName:username]; } } onQueue:nil]; @@ -32,9 +34,12 @@ // 设置自动登录 [[EaseMob sharedInstance].chatManager setIsAutoLoginEnabled:YES]; DLog(@"登陆成功"); + [[NSNotificationCenter defaultCenter] postNotificationName:kLogoutSuccessNotificationName object:nil]; + } EMPushNotificationOptions *options = [[EaseMob sharedInstance].chatManager pushNotificationOptions]; options.nickname = [AWordUser sharedInstance].userName; + options.displayStyle = ePushNotificationDisplayStyle_messageSummary; [[EaseMob sharedInstance].chatManager asyncUpdatePushOptions:options]; } onQueue:nil]; } diff --git a/Ash_AWord/ViewControllers/Chat/Call/CallViewController.h b/Ash_AWord/ViewControllers/Chat/Call/CallViewController.h index 3e57ad7..327cb7c 100644 --- a/Ash_AWord/ViewControllers/Chat/Call/CallViewController.h +++ b/Ash_AWord/ViewControllers/Chat/Call/CallViewController.h @@ -57,6 +57,6 @@ static CTCallCenter *g_callCenter; - (instancetype)initWithSession:(EMCallSession *)session isIncoming:(BOOL)isIncoming withName:(NSString*)name withAvatar:(NSString*)avatar; -+ (BOOL)canVideo; ++ (BOOL)canVideoWithAlertStr:(NSString*)str; @end diff --git a/Ash_AWord/ViewControllers/Chat/Call/CallViewController.m b/Ash_AWord/ViewControllers/Chat/Call/CallViewController.m index 1970fc9..4a4dc5e 100644 --- a/Ash_AWord/ViewControllers/Chat/Call/CallViewController.m +++ b/Ash_AWord/ViewControllers/Chat/Call/CallViewController.m @@ -28,7 +28,6 @@ self = [super initWithNibName:nil bundle:nil]; if (self) { _callSession = session; - _isIncoming = isIncoming; _timeLabel.text = @""; _timeLength = 0; @@ -36,7 +35,11 @@ _avatar = avatar; [[EaseMob sharedInstance].callManager removeDelegate:self]; [[EaseMob sharedInstance].callManager addDelegate:self delegateQueue:nil]; - + if(!isIncoming && session.type==eCallSessionTypeAudio) + { + [self _beginRing]; + + } g_callCenter = [[CTCallCenter alloc] init]; g_callCenter.callEventHandler=^(CTCall* call) { @@ -295,6 +298,9 @@ { [_ringPlayer stop]; + AVAudioSession *audioSession = [AVAudioSession sharedInstance]; + [audioSession setCategory:AVAudioSessionCategoryAmbient error:nil]; + [audioSession setActive:YES error:nil]; NSString *musicPath = [[NSBundle mainBundle] pathForResource:@"callRing" ofType:@"mp3"]; NSURL *url = [[NSURL alloc] initFileURLWithPath:musicPath]; @@ -481,12 +487,13 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer // [self hideHud]; [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; - [self _stopRing]; if(error){ + [self _stopRing]; + _statusLabel.text = @"连接失败"; [self _insertMessageWithStr:@"通话失败"]; - UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"error", @"Error") message:error.description delegate:self cancelButtonTitle:NSLocalizedString(@"ok", @"OK") otherButtonTitles:nil, nil]; + UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"error", @"Error") message:NSLocalizedString(error.description, error.description) delegate:self cancelButtonTitle:NSLocalizedString(@"ok", @"OK") otherButtonTitles:nil, nil]; errorAlert.tag = kAlertViewTag_Close; [errorAlert show]; @@ -494,6 +501,8 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer } if (callSession.status == eCallSessionStatusDisconnected) { + [self _stopRing]; + NSLog(@"callSession.status == eCallSessionStatusDisconnected"); _statusLabel.text = @"通话已挂断"; NSString *str = @"通话结束"; @@ -514,6 +523,8 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer } else if (callSession.status == eCallSessionStatusAccepted) { + [self _stopRing]; + _statusLabel.text = @"可以通话了..."; _timeLength = 0; _timeTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timeTimerAction:) userInfo:nil repeats:YES]; @@ -581,7 +592,6 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer if(![_audioCategory isEqualToString:AVAudioSessionCategoryPlayAndRecord]){ [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil]; [audioSession setActive:YES error:nil]; - NSLog(@"xieyajie===========2"); } [[EaseMob sharedInstance].callManager asyncAnswerCall:_callSession.sessionId]; @@ -601,11 +611,12 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer [[EaseMob sharedInstance].callManager asyncEndCall:_callSession.sessionId reason:eCallReason_Hangup]; } -+ (BOOL)canVideo ++ (BOOL)canVideoWithAlertStr:(NSString *)str { if([[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending){ - if(!([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] == AVAuthorizationStatusAuthorized)){\ - UIAlertView * alt = [[UIAlertView alloc] initWithTitle:@"未获得授权使用摄像头" message:@"请在iOS\"设置中\"-\"隐私\"-\"相机\"中打开" delegate:self cancelButtonTitle:nil otherButtonTitles:@"知道了", nil]; + if(!([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] == AVAuthorizationStatusAuthorized)){ + NSString* alertMsg = [NSString stringWithFormat:@"%@请在iOS\"设置中\"-\"隐私\"-\"相机\"中打开",str]; + UIAlertView * alt = [[UIAlertView alloc] initWithTitle:@"未获得授权使用摄像头" message:alertMsg delegate:self cancelButtonTitle:nil otherButtonTitles:@"知道了", nil]; [alt show]; return NO; } diff --git a/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m b/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m index 758b99c..c190ce7 100644 --- a/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m +++ b/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m @@ -73,22 +73,7 @@ return _slimeView; } -- (instancetype)initWithChatter:(NSString *)chatter conversationType:(EMConversationType)type -{ - self = [super initWithNibName:nil bundle:nil]; - if (self) { - _isPlayingAudio = NO; -// _chatter = chatter; -// _conversationType = type; - _messages = [NSMutableArray array]; - - //根据接收者的username获取当前会话的管理者 - _conversation = [[EaseMob sharedInstance].chatManager conversationForChatter:chatter conversationType:type]; - [_conversation markAllMessagesAsRead:YES]; - } - - return self; -} + - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. @@ -102,6 +87,12 @@ self.navigationItem.title = _otherUserName; + if (!_otherUserName) { + _otherUserName = @""; + } + if (!_otherUserAvatar) { + _otherUserAvatar = @""; + } //根据接收者的username获取当前会话的管理者 _conversation = [[EaseMob sharedInstance].chatManager conversationForChatter:_otherUserId conversationType:eConversationTypeChat]; [_conversation markAllMessagesAsRead:YES]; @@ -365,18 +356,19 @@ { // 隐藏键盘 [self keyBoardHidden]; - EMCallSession *callSession = nil; - EMError *error = nil; - - if (![CallViewController canVideo]) { - return; - } - callSession = [[EaseMob sharedInstance].callManager asyncMakeVideoCall:_conversation.chatter timeout:50 error:&error]; - - - CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:NO withName:_otherUserName withAvatar:_otherUserAvatar]; - callController.modalPresentationStyle = UIModalPresentationOverFullScreen; - [self presentViewController:callController animated:NO completion:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"callOutWithChatter" object:@{@"chatter":_otherUserId, @"type":[NSNumber numberWithInt:eCallSessionTypeVideo],@"username":_otherUserName,@"useravatar":_otherUserAvatar}]; +// EMCallSession *callSession = nil; +// EMError *error = nil; +// +// if (![CallViewController canVideo]) { +// return; +// } +// callSession = [[EaseMob sharedInstance].callManager asyncMakeVideoCall:_conversation.chatter timeout:50 error:&error]; +// +// +// CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:NO withName:_otherUserName withAvatar:_otherUserAvatar]; +// callController.modalPresentationStyle = UIModalPresentationOverFullScreen; +// [self presentViewController:callController animated:NO completion:nil]; } #pragma mark - helper diff --git a/Ash_AWord/ViewControllers/Main/MainViewController.h b/Ash_AWord/ViewControllers/Main/MainViewController.h index aa5c552..0ddf652 100644 --- a/Ash_AWord/ViewControllers/Main/MainViewController.h +++ b/Ash_AWord/ViewControllers/Main/MainViewController.h @@ -10,4 +10,5 @@ @interface MainViewController : UITabBarController +-(NSInteger)setupUnreadMessageCount; @end diff --git a/Ash_AWord/ViewControllers/Main/MainViewController.m b/Ash_AWord/ViewControllers/Main/MainViewController.m index 8117d23..953ef35 100644 --- a/Ash_AWord/ViewControllers/Main/MainViewController.m +++ b/Ash_AWord/ViewControllers/Main/MainViewController.m @@ -92,6 +92,7 @@ static NSString *kMessageType = @"MessageType"; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callOutWithChatter:) name:@"callOutWithChatter" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callControllerClose:) name:@"callControllerClose" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setupUnreadMessageCount) name:kLogoutSuccessNotificationName object:nil]; self.selectedIndex = 0; } @@ -142,7 +143,7 @@ static NSString *kMessageType = @"MessageType"; // 统计未读消息数 --(void)setupUnreadMessageCount +-(NSInteger)setupUnreadMessageCount { NSArray *conversations = [[[EaseMob sharedInstance] chatManager] conversations]; @@ -157,9 +158,10 @@ static NSString *kMessageType = @"MessageType"; _myNav.tabBarItem.badgeValue = nil; } } - UIApplication *application = [UIApplication sharedApplication]; [application setApplicationIconBadgeNumber:unreadCount]; + return unreadCount; + } @@ -232,6 +234,8 @@ static NSString *kMessageType = @"MessageType"; // 收到消息回调 -(void)didReceiveMessage:(EMMessage *)message { + [[NSNotificationCenter defaultCenter] postNotificationName:kReceiveMessage object:nil]; + BOOL needShowNotification = (message.messageType != eMessageTypeChat) ? [self needShowNotification:message.conversationChatter] : YES; if (needShowNotification) { #if !TARGET_IPHONE_SIMULATOR @@ -396,21 +400,21 @@ static NSString *kMessageType = @"MessageType"; #pragma mark - 自动登录回调 - (void)willAutoReconnect{ - [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; - [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.ongoing", @"reconnecting...") hidesAfter:1.0]; +// [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; +// [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.ongoing", @"reconnecting...") hidesAfter:1.0]; // [self hideHud]; // [self showHint:NSLocalizedString(@"reconnection.ongoing", @"reconnecting...")]; } - (void)didAutoReconnectFinishedWithError:(NSError *)error{ // [self hideHud]; - [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; - - if (error) { - [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.fail", @"reconnection failure, later will continue to reconnection") hidesAfter:1.0]; - }else{ - [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.success", @"reconnection successful!") hidesAfter:1.0]; - } +// [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; +// +// if (error) { +// [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.fail", @"reconnection failure, later will continue to reconnection") hidesAfter:1.0]; +// }else{ +// [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.success", @"reconnection successful!") hidesAfter:1.0]; +// } } #pragma mark - ICallManagerDelegate @@ -433,7 +437,7 @@ static NSString *kMessageType = @"MessageType"; } #warning 在后台不能进行视频通话 - if(callSession.type == eCallSessionTypeVideo && ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground || ![CallViewController canVideo])){ + if(callSession.type == eCallSessionTypeVideo && ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground || ![CallViewController canVideoWithAlertStr:@"有人想与你视频,如果需要视频,"])){ error = [EMError errorWithCode:EMErrorInitFailure andDescription:@"不能进行视频通话"]; break; } @@ -470,7 +474,7 @@ static NSString *kMessageType = @"MessageType"; callSession = [[EaseMob sharedInstance].callManager asyncMakeVoiceCall:chatter timeout:50 error:&error]; } else if (type == eCallSessionTypeVideo){ - if (![CallViewController canVideo]) { + if (![CallViewController canVideoWithAlertStr:@""]) { return; } callSession = [[EaseMob sharedInstance].callManager asyncMakeVideoCall:chatter timeout:50 error:&error]; diff --git a/Ash_AWord/ViewControllers/Main/MyViewController.m b/Ash_AWord/ViewControllers/Main/MyViewController.m index 3a61fd5..7bd38f6 100644 --- a/Ash_AWord/ViewControllers/Main/MyViewController.m +++ b/Ash_AWord/ViewControllers/Main/MyViewController.m @@ -14,9 +14,14 @@ #import "MyNoteViewController.h" #import "MyMessageViewController.h" #import "SetUserInfoViewController.h" +#import "MessageListViewController.h" +#import "MyMessageTableViewCell.h" +#import "MainViewController.h" +#import "AppDelegate.h" @interface MyViewController () { NSArray* cellTitleArr; + } @end @@ -49,8 +54,14 @@ //注册通知的观察者 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccess) name:kLoginSuccessNotificationName object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccess) name:kLogoutSuccessNotificationName object:nil]; -} + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccess) name:kReceiveMessage object:nil]; +} +-(void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [self.tableView reloadData]; +} -(void)goSetUp { SetUpViewController* setUpViewController = [[SetUpViewController alloc] init]; @@ -64,7 +75,7 @@ #pragma mark UITableViewDelegate -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2; + return 3; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { @@ -76,9 +87,21 @@ -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString* cellIdentifier = @"cell"; + if (indexPath.section == 2) { + cellIdentifier = @"MyMessageTableViewCell"; + } UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (!cell) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; + if (indexPath.section == 2) { + UINib* nib = nil; + nib = [UINib nibWithNibName:cellIdentifier bundle:nil]; + [tableView registerNib:nib forCellReuseIdentifier:cellIdentifier]; + + cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + }else{ + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; + } + } switch (indexPath.section) { @@ -109,7 +132,9 @@ break; case 2: { - cell.textLabel.text = @"推荐给朋友"; + cell.textLabel.text = @"消息"; + NSInteger count = [((AppDelegate*)[UIApplication sharedApplication].delegate).mainViewController setupUnreadMessageCount]; + [(MyMessageTableViewCell*)cell setUnReadCount:count]; } break; default: @@ -156,6 +181,13 @@ } } + } + break; + case 2: + { + MessageListViewController* messageListViewController = [[MessageListViewController alloc] init]; + messageListViewController.hidesBottomBarWhenPushed = YES; + [self.navigationController pushViewController:messageListViewController animated:YES]; } break; default: diff --git a/Ash_AWord/ViewControllers/Main/NoteViewController.m b/Ash_AWord/ViewControllers/Main/NoteViewController.m index 7ea9d8c..a5666b2 100644 --- a/Ash_AWord/ViewControllers/Main/NoteViewController.m +++ b/Ash_AWord/ViewControllers/Main/NoteViewController.m @@ -163,7 +163,7 @@ { [MobClick event:kUmen_note]; - PropertyEntity* pro = [NoteViewModel requireWithOrder_by:Order_by_Time withPage:_page withPage_size:20]; + PropertyEntity* pro = [NoteViewModel requireWithOrder_by:Order_by_Time withPage:_page withPage_size:DefaultPageSize]; [RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) { NoteViewModel* noteViewModel = (NoteViewModel*)viewModel; diff --git a/Ash_AWord/ViewControllers/My/MessageListViewController.h b/Ash_AWord/ViewControllers/My/MessageListViewController.h new file mode 100644 index 0000000..7911a64 --- /dev/null +++ b/Ash_AWord/ViewControllers/My/MessageListViewController.h @@ -0,0 +1,14 @@ +// +// MessageListViewController.h +// Ash_AWord +// +// Created by xmfish on 15/6/25. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import +#import "BaseRefreshViewController.h" +@interface MessageListViewController : BaseRefreshViewController +@property (weak, nonatomic) IBOutlet UITableView *tableView; + +@end diff --git a/Ash_AWord/ViewControllers/My/MessageListViewController.m b/Ash_AWord/ViewControllers/My/MessageListViewController.m new file mode 100644 index 0000000..c99c440 --- /dev/null +++ b/Ash_AWord/ViewControllers/My/MessageListViewController.m @@ -0,0 +1,176 @@ +// +// MessageListViewController.m +// Ash_AWord +// +// Created by xmfish on 15/6/25. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "MessageListViewController.h" +#import "MessageListTableViewCell.h" +#import "ChatMainViewController.h" +#import "UserViewModel.h" +@interface MessageListViewController () +{ + NSInteger _page; + NSMutableArray* _dataArr; + NSMutableArray* _userArr; + +} +@end + +@implementation MessageListViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. + + [self customViewDidLoad]; + _userArr = [NSMutableArray array]; + + self.navigationItem.title = @"消息列表"; + self.tableView.delegate = self; + self.tableView.dataSource = self; + [self.tableView removeFooter]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +-(void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + [self loadData]; + +} +-(void)headerRereshing +{ + _page=1; + [self loadData]; +} +-(void)footerRereshing +{ + [self loadData]; +} +-(void)loadData +{ + NSArray *conversations = [[EaseMob sharedInstance].chatManager conversations]; + + NSArray* sorte = [conversations sortedArrayUsingComparator: + ^(EMConversation *obj1, EMConversation* obj2){ + EMMessage *message1 = [obj1 latestMessage]; + EMMessage *message2 = [obj2 latestMessage]; + if(message1.timestamp > message2.timestamp) { + return(NSComparisonResult)NSOrderedAscending; + }else { + return(NSComparisonResult)NSOrderedDescending; + } + }]; + + _dataArr = [[NSMutableArray alloc] initWithArray:sorte]; + + NSMutableArray* uidArr = [NSMutableArray array]; + for (EMConversation* conversation in _dataArr) { + [uidArr addObject:conversation.chatter]; + } + PropertyEntity* pro = [UserViewModel requireUserListWithUid:uidArr]; + [RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) { + + if ([viewModel success]) { + [_userArr removeAllObjects]; + _userArr = [NSMutableArray arrayWithArray:[(UserViewModel*)viewModel userBaseInfoArr]]; + } + + [self.tableView reloadData]; + [self.tableView.header endRefreshing]; + } failedBlock:^(NSError *error) { + [self.tableView reloadData]; + [self.tableView.header endRefreshing]; + }]; + +} +#pragma mark UITableViewDelegate +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + + return _dataArr.count; + +} +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + return 50.0; + +} +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section +{ + + return 10.0; +} +-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section +{ + return 0.01; +} +-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSString* cellIdentifier = @"MessageListTableViewCell"; + MessageListTableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + if (!cell) { + UINib* nib = nil; + nib = [UINib nibWithNibName:cellIdentifier bundle:nil]; + [tableView registerNib:nib forCellReuseIdentifier:cellIdentifier]; + + cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + } + + EMConversation* conversation = [_dataArr objectAtIndex:indexPath.row]; + [cell setEMConversation:conversation]; + UserInfoViewModel* userinfo; + for (UserInfoViewModel* user in _userArr) { + if ([user.uid isEqualToString:conversation.chatter]) { + userinfo = user; + break; + } + } + [cell setUserInfo:userinfo]; + + return cell; + +} +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + + EMConversation* conversation = [_dataArr objectAtIndex:indexPath.row]; + + ChatMainViewController* chatMainViewController = [[ChatMainViewController alloc] init]; + chatMainViewController.otherUserId = conversation.chatter; + chatMainViewController.otherUserName = conversation.chatter; + for (UserInfoViewModel* user in _userArr) { + if ([user.uid isEqualToString:conversation.chatter]) { + chatMainViewController.otherUserAvatar = user.figureurl; + chatMainViewController.otherUserName = user.name; + break; + } + } + + + [self.navigationController pushViewController:chatMainViewController animated:YES]; +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Ash_AWord/ViewControllers/My/MessageListViewController.xib b/Ash_AWord/ViewControllers/My/MessageListViewController.xib new file mode 100644 index 0000000..916aeb5 --- /dev/null +++ b/Ash_AWord/ViewControllers/My/MessageListViewController.xib @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/ViewControllers/My/SetUpViewController.m b/Ash_AWord/ViewControllers/My/SetUpViewController.m index e35f37a..aeec3bf 100644 --- a/Ash_AWord/ViewControllers/My/SetUpViewController.m +++ b/Ash_AWord/ViewControllers/My/SetUpViewController.m @@ -197,7 +197,7 @@ if (buttonIndex == 1 &&alertView.tag == 101) { [MobClick event:kUmen_logout]; - [[EaseMob sharedInstance].chatManager asyncLogoffWithUnbindDeviceToken:NO completion:^(NSDictionary *info, EMError *error) { + [[EaseMob sharedInstance].chatManager asyncLogoffWithUnbindDeviceToken:YES completion:^(NSDictionary *info, EMError *error) { if (!error && info) { } @@ -262,10 +262,7 @@ } if(content.length <= 0) { - - content = @"最真的表白,是我欲言又止的沉默"; - } if (url.length <= 0) { NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/us/app/id%d", kAppleID]; diff --git a/Ash_AWord/ViewModels/Common/UserViewModel.h b/Ash_AWord/ViewModels/Common/UserViewModel.h index b645808..adeffb7 100644 --- a/Ash_AWord/ViewModels/Common/UserViewModel.h +++ b/Ash_AWord/ViewModels/Common/UserViewModel.h @@ -27,6 +27,7 @@ @property (nonatomic, strong) NSArray *userInfoArr; @property (nonatomic, strong) NSArray *friendUserArr; @property (nonatomic, strong)UserInfoViewModel* userInfo; +@property (nonatomic, strong) NSArray *userBaseInfoArr; @property (nonatomic, assign)NSInteger relation;//与当前用户关系。0:没有关系,1:已关注此人,2:已被此人关注,3:相互关注(如果是获取自己的个人信息,可以无视该项0.0) +(PropertyEntity*)requireLoadPraiseUserWithRecordId:(NSInteger)recordId withPage:(NSInteger)page withPage_size:(NSInteger)page_size withType:(CommentType)type; @@ -34,4 +35,6 @@ +(PropertyEntity*)requireLoadUserListWithTargetUid:(NSString*)targetUid withType:(NSInteger)isAttention withPage:(NSInteger)page withPage_size:(NSInteger)page_size; // 1是关注列表,2是粉丝列表 +(PropertyEntity*)requireAttentionWithTargetUid:(NSString*)targetUid withIsAttention:(BOOL)isAttention; + ++(PropertyEntity*)requireUserListWithUid:(NSArray*)uidArr; @end diff --git a/Ash_AWord/ViewModels/Common/UserViewModel.m b/Ash_AWord/ViewModels/Common/UserViewModel.m index a890bef..c25a7ef 100644 --- a/Ash_AWord/ViewModels/Common/UserViewModel.m +++ b/Ash_AWord/ViewModels/Common/UserViewModel.m @@ -21,6 +21,7 @@ [dic setObject:@"users" forKey:@"userInfoArr"]; [dic setObject:@"friends" forKey:@"friendUserArr"]; [dic setObject:@"userinfo" forKey:@"userInfo"]; + [dic setObject:@"userBaseInfos" forKey:@"userBaseInfoArr"]; return dic; } - (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error { @@ -33,6 +34,9 @@ return self; } ++ (NSValueTransformer *)userBaseInfoArrJSONTransformer{ + return [NSValueTransformer mtl_JSONArrayTransformerWithModelClass:UserInfoViewModel.class]; +} + (NSValueTransformer *)userInfoArrJSONTransformer{ return [NSValueTransformer mtl_JSONArrayTransformerWithModelClass:UserInfoViewModel.class]; } @@ -115,4 +119,23 @@ }; return pro; } + ++(PropertyEntity*)requireUserListWithUid:(NSArray *)uidArr +{ + PropertyEntity *pro = [[PropertyEntity alloc] init]; + pro.requireType = HTTPRequestTypeWithPOSTDATA; + pro.responesOBJ = self.class; + + if (uidArr.count == 0) { + uidArr = [NSArray array]; + } + NSDictionary* dic = @{@"targetUids": uidArr, + }; + NSString* command = @"10010"; + + pro.pro = @{@"root": dic, + @"command": command, + }; + return pro; +} @end \ No newline at end of file diff --git a/Ash_AWord/Views/Common/MyMessageTableViewCell.h b/Ash_AWord/Views/Common/MyMessageTableViewCell.h new file mode 100644 index 0000000..ee8906f --- /dev/null +++ b/Ash_AWord/Views/Common/MyMessageTableViewCell.h @@ -0,0 +1,15 @@ +// +// MyMessageTableViewCell.h +// Ash_AWord +// +// Created by xmfish on 15/6/25. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import + +@interface MyMessageTableViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *unReadCountLabel; + +-(void)setUnReadCount:(NSInteger)unReadConut; +@end diff --git a/Ash_AWord/Views/Common/MyMessageTableViewCell.m b/Ash_AWord/Views/Common/MyMessageTableViewCell.m new file mode 100644 index 0000000..0d90adc --- /dev/null +++ b/Ash_AWord/Views/Common/MyMessageTableViewCell.m @@ -0,0 +1,33 @@ +// +// MyMessageTableViewCell.m +// Ash_AWord +// +// Created by xmfish on 15/6/25. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "MyMessageTableViewCell.h" + +@implementation MyMessageTableViewCell + +- (void)awakeFromNib { + // Initialization code + _unReadCountLabel.layer.cornerRadius = 10.0; + _unReadCountLabel.layer.masksToBounds = YES; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} +-(void)setUnReadCount:(NSInteger)unReadConut +{ + if (unReadConut > 0) { + _unReadCountLabel.hidden = NO; + _unReadCountLabel.text = [NSString stringWithFormat:@"%ld",unReadConut]; + }else{ + _unReadCountLabel.hidden = YES; + } +} +@end diff --git a/Ash_AWord/Views/Common/MyMessageTableViewCell.xib b/Ash_AWord/Views/Common/MyMessageTableViewCell.xib new file mode 100644 index 0000000..61b6972 --- /dev/null +++ b/Ash_AWord/Views/Common/MyMessageTableViewCell.xib @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/Views/Message/MessageTableViewCell.m b/Ash_AWord/Views/Message/MessageTableViewCell.m index 246e1c5..d0e3e9f 100644 --- a/Ash_AWord/Views/Message/MessageTableViewCell.m +++ b/Ash_AWord/Views/Message/MessageTableViewCell.m @@ -176,7 +176,7 @@ } - (IBAction)shareBtnClick:(id)sender { - [SetUpViewController shareAppWithViewController:nil andTitle:@"遇见你" andContent:_text_voice.content andImage:nil andUrl:[NSString stringWithFormat:@"%@/web/voice_share_info?record_id=%ld",Ash_AWord_API_URL,_text_voice.messageId]]; + [SetUpViewController shareAppWithViewController:nil andTitle:@"遇见你" andContent:_text_voice.content andImage:nil andUrl:[NSString stringWithFormat:@"%@/voice_share_info?record_id=%ld",Ash_AWord_Share_URL,_text_voice.messageId]]; PropertyEntity* pro = [MessageViewModel requireShareWithRecordId:_text_voice.messageId]; [RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) { if ([viewModel success]) { diff --git a/Ash_AWord/Views/Note/NoteTableViewCell.m b/Ash_AWord/Views/Note/NoteTableViewCell.m index 158a4a1..ad83cfc 100644 --- a/Ash_AWord/Views/Note/NoteTableViewCell.m +++ b/Ash_AWord/Views/Note/NoteTableViewCell.m @@ -130,7 +130,7 @@ - (IBAction)shareBtnClick:(id)sender { - [SetUpViewController shareAppWithViewController:nil andTitle:@"遇见你" andContent:_text_image.content andImage:_contentImgView.image andUrl:[NSString stringWithFormat:@"%@/web/image_share_info?record_id=%ld",Ash_AWord_API_URL,(long)_text_image.messageId]]; + [SetUpViewController shareAppWithViewController:nil andTitle:@"遇见你" andContent:_text_image.content andImage:_contentImgView.image andUrl:[NSString stringWithFormat:@"%@/image_share_info?record_id=%ld",Ash_AWord_Share_URL,(long)_text_image.messageId]]; PropertyEntity* pro = [NoteViewModel requireShareWithRecordId:_text_image.messageId]; [RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) { if ([viewModel success]) { diff --git a/Ash_AWord/Views/User/MessageListTableViewCell.h b/Ash_AWord/Views/User/MessageListTableViewCell.h new file mode 100644 index 0000000..f463767 --- /dev/null +++ b/Ash_AWord/Views/User/MessageListTableViewCell.h @@ -0,0 +1,21 @@ +// +// MessageListTableViewCell.h +// Ash_AWord +// +// Created by xmfish on 15/6/25. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import +@class EMConversation; +@class UserInfoViewModel; +@interface MessageListTableViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *unReadLabel; +@property (weak, nonatomic) IBOutlet UILabel *timeLabel; +@property (weak, nonatomic) IBOutlet UILabel *lastMsgLabel; +@property (weak, nonatomic) IBOutlet UIImageView *avatarImageView; + +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +-(void)setEMConversation:(EMConversation*)conversation; +-(void)setUserInfo:(UserInfoViewModel*)userInfo; +@end diff --git a/Ash_AWord/Views/User/MessageListTableViewCell.m b/Ash_AWord/Views/User/MessageListTableViewCell.m new file mode 100644 index 0000000..bb872c7 --- /dev/null +++ b/Ash_AWord/Views/User/MessageListTableViewCell.m @@ -0,0 +1,100 @@ +// +// MessageListTableViewCell.m +// Ash_AWord +// +// Created by xmfish on 15/6/25. +// Copyright (c) 2015年 ash. All rights reserved. +// + +#import "MessageListTableViewCell.h" +#import "EMConversation.h" +#import "ConvertToCommonEmoticonsHelper.h" +#import "UserViewModel.h" +@implementation MessageListTableViewCell + +- (void)awakeFromNib { + // Initialization code + _unReadLabel.layer.cornerRadius = 10.0; + _unReadLabel.layer.masksToBounds = YES; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +-(void)setUnReadCount:(NSInteger)count +{ + if (count == 0) { + _unReadLabel.hidden = YES; + }else{ + _unReadLabel.hidden = NO; + _unReadLabel.text = [NSString stringWithFormat:@"%ld",count]; + } +} +-(void)setEMConversation:(EMConversation *)conversation +{ + + EMMessage *lastMessage = [conversation latestMessage];; + if (lastMessage) { + _timeLabel.hidden = NO; + NSString* str = [NSString stringWithFormat:@"%lld",lastMessage.timestamp]; + _timeLabel.text = [CommonUtil timeFromtimeSp:str]; + }else{ + _timeLabel.hidden = YES; + } + + [self setUnReadCount:conversation.unreadMessagesCount]; + + _lastMsgLabel.text = [self subTitleMessageByConversation:conversation]; + + _nameLabel.text = conversation.chatter; +} +-(void)setUserInfo:(UserInfoViewModel *)userInfo +{ + + if (userInfo) { + _nameLabel.text = userInfo.name; + [_avatarImageView sd_setImageWithURL:[NSURL URLWithString:userInfo.figureurl] placeholderImage:DefaultUserIcon]; + + }else{ + [_avatarImageView sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:DefaultUserIcon]; + } + +} +// 得到最后消息文字或者类型 +-(NSString *)subTitleMessageByConversation:(EMConversation *)conversation +{ + NSString *ret = @""; + EMMessage *lastMessage = [conversation latestMessage]; + if (lastMessage) { + id messageBody = lastMessage.messageBodies.lastObject; + switch (messageBody.messageBodyType) { + case eMessageBodyType_Image:{ + ret = NSLocalizedString(@"message.image1", @"[image]"); + } break; + case eMessageBodyType_Text:{ + // 表情映射。 + NSString *didReceiveText = [ConvertToCommonEmoticonsHelper + convertToSystemEmoticons:((EMTextMessageBody *)messageBody).text]; + ret = didReceiveText; + } break; + case eMessageBodyType_Voice:{ + ret = NSLocalizedString(@"message.voice1", @"[voice]"); + } break; + case eMessageBodyType_Location: { + ret = NSLocalizedString(@"message.location1", @"[location]"); + } break; + case eMessageBodyType_Video: { + ret = NSLocalizedString(@"message.vidio1", @"[vidio]"); + } break; + default: { + } break; + } + } + + return ret; +} + +@end diff --git a/Ash_AWord/Views/User/MessageListTableViewCell.xib b/Ash_AWord/Views/User/MessageListTableViewCell.xib new file mode 100644 index 0000000..2ed870f --- /dev/null +++ b/Ash_AWord/Views/User/MessageListTableViewCell.xib @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +