mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-11 05:45:56 +10:00
Add comments for TODO
This commit is contained in:
@@ -312,13 +312,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
}
|
||||
|
||||
func sync() {
|
||||
|
||||
|
||||
// TODO 随着群组和好友越来越多,这个方法会导致 App 开启的时候,获取到离线消息愈来越慢
|
||||
|
||||
syncFriendshipsAndDoFurtherAction {
|
||||
syncGroupsAndDoFurtherAction { [weak self] in
|
||||
self?.syncUnreadMessages() {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
officialMessages { messagesCount in
|
||||
println("new officialMessages count: \(messagesCount)")
|
||||
}
|
||||
|
||||
@@ -957,6 +957,8 @@ func syncMessageWithMessageInfo(messageInfo: JSONDictionary, messageAge: Message
|
||||
let newUser = User()
|
||||
|
||||
newUser.userID = senderID
|
||||
|
||||
//TODO 服务器个消息的 Sender 加入一个用户状态,避免暴力标记为 Stranger
|
||||
|
||||
newUser.friendState = UserFriendState.Stranger.rawValue
|
||||
|
||||
@@ -980,6 +982,7 @@ func syncMessageWithMessageInfo(messageInfo: JSONDictionary, messageAge: Message
|
||||
var sendFromGroup: Group? = nil
|
||||
|
||||
if let recipientType = messageInfo["recipient_type"] as? String {
|
||||
|
||||
if recipientType == "Circle" {
|
||||
if let groupID = messageInfo["recipient_id"] as? String {
|
||||
sendFromGroup = groupWithGroupID(groupID, inRealm: realm)
|
||||
@@ -1001,6 +1004,8 @@ func syncMessageWithMessageInfo(messageInfo: JSONDictionary, messageAge: Message
|
||||
|
||||
sendFromGroup = newGroup
|
||||
|
||||
// TODO 存在多次网络查询这个 Group 的可能性
|
||||
|
||||
groupWithGroupID(groupID: groupID, failureHandler: nil, completion: { (groupInfo) -> Void in
|
||||
dispatch_async(realmQueue) {
|
||||
guard let realmForGroup = try? Realm() else {
|
||||
|
||||
Reference in New Issue
Block a user