Esempio n. 1
0
        internal static FB_PollCreated _parse(Session session, JToken data)
        {
            (FB_User author, FB_Thread thread, long at) = FB_PollCreated._parse_metadata(session, data);
            var poll_json = JToken.Parse(data?.get("untypedData")?.get("question_json")?.Value <string>());
            var poll      = FB_Poll._from_graphql(poll_json, session);

            return(new FB_PollCreated()
            {
                author = author,
                thread = thread,
                poll = poll,
                at = at
            });
        }
Esempio n. 2
0
        internal static FB_PollVoted _parse(Session session, JToken data)
        {
            (FB_User author, FB_Thread thread, long at) = FB_PollVoted._parse_metadata(session, data);
            var poll_json       = JToken.Parse(data?.get("untypedData")?.get("question_json")?.Value <string>());
            var poll            = FB_Poll._from_graphql(poll_json, session);
            var added_options   = JToken.Parse(data?.get("untypedData")?.get("added_option_ids")?.Value <string>());
            var removed_options = JToken.Parse(data?.get("untypedData")?.get("removed_option_ids")?.Value <string>());

            return(new FB_PollVoted()
            {
                author = author,
                thread = thread,
                poll = poll,
                added_ids = added_options.Select(x => x.ToString()).ToList(),
                removed_ids = removed_options.Select(x => x.ToString()).ToList(),
                at = at
            });
        }