                         guard let realm = try? Realm() else {
                             return
                         }
+
+                        var messageIDs = [String]()
+
+                        realm.beginWrite()
 
                         // 同步最新的几个
                         var i = 0


                    newMessage.socialWork = socialWork

                    let _ = try? realm.write {
                        realm.add(newMessage)
                    }

                    message = newMessage
                }

                if let message = message {
                    let _ = try? realm.write {
                        message.fromFriend = yepTeam
                    }

                    var conversation = yepTeam.conversation



                    newYepTeam.friendState = UserFriendState.Yep.rawValue

                    realm.add(newYepTeam)

                    yepTeam = newYepTeam
                }
