private bool Chat(ChatRequest profile, Filter filter) { TouchAt(Screen.ChatScreenTextField); Delay(300); var messages = ZaloHelper.GetZalomessages(profile.Profile, filter); foreach (var message in messages) { DeleteWordInFocusedTextField(20); if (message.Type == ZaloMessageType.Text) { SendText(message.Value); Delay(500); if (!IsDebug) { //TouchAt(Screen.ChatScreenSendButton); SendKey(KeyCode.AkeycodeEnter); } ZaloHelper.Output($"Gửi tin nhắn chữ '{message.Value}' tới bạn '{profile.Profile.Name}' thành công"); } else { UpImageChat(new System.IO.FileInfo(message.Value)); Delay(500); TouchAt(Screen.ChatScreenOpenMoreWindowButton); Delay(500); TouchAt(Screen.ChatScreenAddImageButton); Delay(500); TouchAt(Screen.UploadAlbumDCimFolter); Delay(500); TouchAt(Screen.UploadAlbumFirstImageCheckBox); if (!Settings.IsDebug) { Delay(500); TouchAt(Screen.UploadAlbumSendButton); } else { Delay(500); TouchAtIconTopLeft(); Delay(500); TouchAtIconTopLeft(); } ZaloHelper.Output($"Gửi tin nhắn hình '{message.Value}' tới bạn '{profile.Profile.Name}' thành công"); Delay(900); TouchAt(Screen.ChatScreenCloseMoreWindowButton); Delay(100); } Delay(1000); switch (profile.Objective) { case ChatObjective.FriendInContactList: DbContext.AddLogMessageSentToFriend(profile.Profile, Settings.User.Username, message.Value); break; case ChatObjective.StrangerByPhone: case ChatObjective.StrangerNearBy: DbContext.AddLogMessageSentToStranger(profile.Profile, Settings.User.Username, message.Value); break; } } return(true); }