             }
         }
 
-
-
-        return data
+        return messagesCount
     }
 
     let resource = authJsonResource(path: "/api/v1/official_messages", method: .GET, requestParameters: [:], parse: parse)


// MARK: - Messages

func officialMessages(#completion: JSONDictionary -> Void) {

    let parse: JSONDictionary -> JSONDictionary? = { data in

        if let senderInfo = data["sender"] as? JSONDictionary, senderID = senderInfo["id"] as? String {


                                // 纪录消息的 detail 信息

                                recordMessageWithMessageID(messageID, detailInfo: messageInfo, inRealm: realm)

                                messagesCount++
                            }
                        }
                    }
