Inheritance: VkNet.Model.Attachments.MediaAttachment
Ejemplo n.º 1
0
 //  VkNet.Model.Message Message;
 public Msg(VkNet.Model.Message Message)
 {
     // this.Message = Message;
     Image = Message.FromId.Value.ToString();
     Text  = Message.Text;
     if (Text == "")
     {
         Text = "Вложение";
     }
     Name = Message.FromId.ToString();
     Date = Message.Date.Value;
 }
Ejemplo n.º 2
0
 public MyDialog(Conversation C, VkNet.Model.Message LastMessage)
 {
     UpdateInfo(LastMessage, C);
 }
Ejemplo n.º 3
0
 public void UpdateInfo(VkNet.Model.Message LastMessage, Conversation C)
 {
     this.Conv        = C;
     this.LastMessage = LastMessage;
     init();
 }
Ejemplo n.º 4
0
        internal static Message FromJson(VkResponse response)
        {
            var message = new Message();

            message.Unread = response.ContainsKey("unread") ? response["unread"] : 0;

            if (response.ContainsKey("message"))
                response = response["message"];

            message.Id = response["id"];
            message.UserId = response["user_id"];
            message.Date = response["date"];
            message.ReadState = response["read_state"];
            message.Type = response["out"];
            message.Title = response["title"];
            message.Body = response["body"];
            message.Attachments = response["attachments"];
            message.Geo = response["geo"];
            message.ForwardedMessages = response["fwd_messages"];
            message.ContainsEmojiSmiles = response["emoji"];
            message.IsImportant = response["important"];
            message.IsDeleted = response["deleted"];

            // дополнительные поля бесед

            message.ChatId = response["chat_id"];
            message.ChatActiveIds = response["chat_active"];
            message.UsersCount = response["users_count"];
            message.AdminId = response["admin_id"];
            message.PhotoPreviews = response;

            return message;
        }
Ejemplo n.º 5
0
 private DateTime func(VkNet.Model.Message m)
 {
     return(m.Date.GetValueOrDefault());
 }
Ejemplo n.º 6
0
Archivo: Message.cs Proyecto: ProESM/vk
		internal static Message FromJson(VkResponse response)
		{
			if (response.ContainsKey("message"))
			{
				response = response["message"];
			}
			var message = new Message
			{
				Unread = response.ContainsKey("unread") ? response["unread"] : 0,
				Id = response["id"],
				UserId = response["user_id"],
				Date = response["date"],
				ReadState = response["read_state"],
				Type = response["out"],
				Title = response["title"],
				Body = response["body"],
				Attachments = response["attachments"],
				Geo = response["geo"],
				ForwardedMessages = response["fwd_messages"],
				ContainsEmojiSmiles = response["emoji"],
				IsImportant = response["important"],
				IsDeleted = response["deleted"],
				FromId = response["from_id"],
				// дополнительные поля бесед
				ChatId = response["chat_id"],
				ChatActiveIds = response["chat_active"],
				UsersCount = response["users_count"],
				AdminId = response["admin_id"],
				PhotoPreviews = response,
				PushSettings = response["push_settings"],
				Action = response["action"],
				ActionMid = response["action_mid"],
				ActionEmail = response["action_email"],
				ActionText = response["action_text"],
				Photo50 = response["photo_50"],
				Photo100 = response["photo_100"],
				Photo200 = response["photo_200"],

				InRead = response["in_read"],
				OutRead = response["out_read"]
			};


			return message;
		}