Ejemplo n.º 1
0
 private static FB_Event parse_client_delta(Session session, JToken data)
 {
     if (data?.get("deltaMessageReaction") != null)
     {
         return(FB_ReactionEvent._parse(session, data["deltaMessageReaction"]));
     }
     else if (data?.get("deltaChangeViewerStatus") != null)
     {
         // TODO: Parse all `reason`
         if (data?.get("deltaChangeViewerStatus")?.get("reason")?.Value <int>() == 2)
         {
             return(FB_UserStatusEvent._parse(session, data["deltaChangeViewerStatus"]));
         }
     }
     else if (data?.get("liveLocationData") != null)
     {
         return(FB_LiveLocationEvent._parse(session, data["liveLocationData"]));
     }
     else if (data?.get("deltaRecallMessageData") != null)
     {
         return(FB_UnsendEvent._parse(session, data["deltaRecallMessageData"]));
     }
     else if (data?.get("deltaMessageReply") != null)
     {
         return(FB_MessageReplyEvent._parse(session, data["deltaMessageReply"]));
     }
     return(new FB_UnknownEvent()
     {
         source = "client payload", data = data
     });
 }
Ejemplo n.º 2
0
        /// TODO: This!

        internal static FB_LiveLocationEvent _parse(Session session, JToken data)
        {
            var thread = FB_LiveLocationEvent._get_thread(session, data);

            foreach (var location_data in data?.get("messageLiveLocations") ?? Enumerable.Empty <JToken>())
            {
                var message  = new FB_Message(session: session, thread_id: thread.uid, uid: data?.get("messageId")?.Value <string>());
                var author   = new FB_User(session: session, uid: location_data?.get("senderId")?.Value <string>());
                var location = FB_LiveLocationAttachment._from_pull(location_data);
            }

            return(null);
        }