Esempio n. 1
0
        internal static (FB_User author, FB_Thread thread, long at) _parse_metadata(Session session, JToken data)
        {
            var metadata = data?.get("messageMetadata");
            var author   = new FB_User(session: session, uid: metadata?.get("actorFbId")?.Value <string>());
            var thread   = FB_ThreadEvent._get_thread(session, metadata);
            var at       = long.Parse(metadata?.get("timestamp")?.Value <string>());

            return(author, thread, at);
        }
Esempio n. 2
0
        internal static FB_ThreadFolder _parse(Session session, JToken data)
        {
            var thread = FB_ThreadEvent._get_thread(session, data);
            var folder = data?.get("folder")?.Value <string>();

            return(new FB_ThreadFolder()
            {
                thread = thread,
                folder = folder
            });
        }
Esempio n. 3
0
        internal static FB_UnfetchedThreadEvent _parse(Session session, JToken data)
        {
            var thread  = FB_ThreadEvent._get_thread(session, data);
            var message = new FB_Message(session, thread_id: thread.uid, uid: data?.get("messageId")?.Value <string>());

            return(new FB_UnfetchedThreadEvent()
            {
                thread = thread,
                message = message
            });
        }
Esempio n. 4
0
        internal static FB_ThreadsRead _parse(Session session, JToken data)
        {
            var author  = new FB_User(session.user.uid, session);
            var threads = data?.get("threadKeys")?.Select(x => FB_ThreadEvent._get_thread(session, new JObject()
            {
                { "threadKey", x }
            }));
            var at = long.Parse(data?.get("actionTimestamp")?.Value <string>());

            return(new FB_ThreadsRead()
            {
                author = author,
                threads = threads.ToList(),
                at = at
            });
        }
Esempio n. 5
0
        internal static FB_ThreadsRead _parse_read_receipt(Session session, JToken data)
        {
            var author = new FB_User(session: session, uid: data?.get("actorFbId")?.Value <string>());
            var thread = FB_ThreadEvent._get_thread(session, data);
            var at     = long.Parse(data.get("actionTimestampMs")?.Value <string>());

            return(new FB_ThreadsRead()
            {
                author = author,
                threads = new List <FB_Thread>()
                {
                    thread
                },
                at = at
            });
        }