Skip to content

Commit

Permalink
'#1923: Handle iOS type 10/event 56 (sender was added to contacts).
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Jan 5, 2024
1 parent 0c62c57 commit 396e00e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ WhatsAppReport.ChangedNumberTo=change to
WhatsAppReport.ChangedNumberChattingWithNew=changed their phone number. You're currently chatting with their new number.
WhatsAppReport.ChangedNumberChattingWithOld=changed their phone number to a new number. Tap to message the new number.
WhatsAppReport.SenderInContacts=is in your contacts.
WhatsAppReport.SenderAddedToContacts=was added to your contacts.
WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.
WhatsAppReport.GroupAddedToCommunity=Group was added to a community.
WhatsAppReport.CommunityManagementAction=Community management action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ WhatsAppReport.ChangedNumberTo=change to[TBT]
WhatsAppReport.ChangedNumberChattingWithNew=changed their phone number. You're currently chatting with their new number.[TBT]
WhatsAppReport.ChangedNumberChattingWithOld=changed their phone number to a new number. Tap to message the new number.[TBT]
WhatsAppReport.SenderInContacts=is in your contacts.[TBT]
WhatsAppReport.SenderAddedToContacts=was added to your contacts.[TBT]
WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT]
WhatsAppReport.GroupAddedToCommunity=Group was added to a community.[TBT]
WhatsAppReport.CommunityManagementAction=Community management action.[TBT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ WhatsAppReport.ChangedNumberTo=change to[TBT]
WhatsAppReport.ChangedNumberChattingWithNew=changed their phone number. You're currently chatting with their new number.[TBT]
WhatsAppReport.ChangedNumberChattingWithOld=changed their phone number to a new number. Tap to message the new number.[TBT]
WhatsAppReport.SenderInContacts=is in your contacts.[TBT]
WhatsAppReport.SenderAddedToContacts=was added to your contacts.[TBT]
WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT]
WhatsAppReport.GroupAddedToCommunity=Group was added to a community.[TBT]
WhatsAppReport.CommunityManagementAction=Community management action.[TBT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ WhatsAppReport.ChangedNumberTo=change to[TBT]
WhatsAppReport.ChangedNumberChattingWithNew=changed their phone number. You're currently chatting with their new number.[TBT]
WhatsAppReport.ChangedNumberChattingWithOld=changed their phone number to a new number. Tap to message the new number.[TBT]
WhatsAppReport.SenderInContacts=is in your contacts.[TBT]
WhatsAppReport.SenderAddedToContacts=was added to your contacts.[TBT]
WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT]
WhatsAppReport.GroupAddedToCommunity=Group was added to a community.[TBT]
WhatsAppReport.CommunityManagementAction=Community management action.[TBT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ WhatsAppReport.ChangedNumberTo=mudou para
WhatsAppReport.ChangedNumberChattingWithNew=mudou de número de telefone. Você está em contato com o número novo neste momento.
WhatsAppReport.ChangedNumberChattingWithOld=mudou de número de telefone. Toque para enviar uma mensagem ao novo número.
WhatsAppReport.SenderInContacts=está na sua lista de contatos.
WhatsAppReport.SenderAddedToContacts=foi adicionado à sua lista de contatos.
WhatsAppReport.ChatBusinessOfficial=Você está conversando com uma conta comercial oficial.
WhatsAppReport.GroupAddedToCommunity=Grupo foi adicionado a comunidade.
WhatsAppReport.CommunityManagementAction=Ação de gerenciamento de comunidade.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static iped.parsers.whatsapp.Message.MessageType.MESSAGES_NOW_ENCRYPTED;
import static iped.parsers.whatsapp.Message.MessageType.MISSED_VIDEO_CALL;
import static iped.parsers.whatsapp.Message.MessageType.MISSED_VOICE_CALL;
import static iped.parsers.whatsapp.Message.MessageType.SENDER_ADDED_TO_CONTACTS;
import static iped.parsers.whatsapp.Message.MessageType.STICKER_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.TEXT_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.UNBLOCKED_CONTACT;
Expand Down Expand Up @@ -770,6 +771,8 @@ protected Message.MessageType decodeMessageType(int messageType, int gEventType)
result = VIDEO_CALL;
} else if (gEventType == 47) {
result = EPHEMERAL_SAVE;
} else if (gEventType == 56) {
result = SENDER_ADDED_TO_CONTACTS;
}
// 10 / 13 -> desconhecida (aparece algumas vezes depois de informado conversa
// segura com nome do interlocutor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ public void setOrder(MessageOrder order) {
}

public static enum MessageType {
TEXT_MESSAGE, IMAGE_MESSAGE, AUDIO_MESSAGE, VIDEO_MESSAGE, UNKNOWN_MEDIA_MESSAGE, CONTACT_MESSAGE, LOCATION_MESSAGE, SHARE_LOCATION_MESSAGE, VOICE_CALL, VIDEO_CALL, APP_MESSAGE, GIF_MESSAGE, BLOCKED_CONTACT, UNBLOCKED_CONTACT, BUSINESS_CHAT, BUSINESS_TO_STANDARD, MESSAGES_ENCRYPTED, MESSAGES_NOW_ENCRYPTED, ENCRYPTION_KEY_CHANGED, MISSED_VOICE_CALL, MISSED_VIDEO_CALL, DELETED_MESSAGE, DELETED_BY_ADMIN, DELETED_BY_SENDER, GROUP_CREATED, USER_JOINED_GROUP, USER_JOINED_GROUP_FROM_LINK, USERS_JOINED_GROUP, USER_LEFT_GROUP, USER_REMOVED_FROM_GROUP, URL_MESSAGE, GROUP_ICON_CHANGED, GROUP_ICON_DELETED, GROUP_DESCRIPTION_CHANGED, SUBJECT_CHANGED, YOU_ADMIN, YOU_NOT_ADMIN, WAITING_MESSAGE, STICKER_MESSAGE, REFUSED_VIDEO_CALL, REFUSED_VOICE_CALL, UNAVAILABLE_VIDEO_CALL, UNAVAILABLE_VOICE_CALL, UNKNOWN_VOICE_CALL, UNKNOWN_VIDEO_CALL, VIEW_ONCE_IMAGE_MESSAGE, VIEW_ONCE_VIDEO_MESSAGE, CALL_MESSAGE, BUSINESS_META_SECURE_SERVICE, GROUP_INVITE, TEMPLATE_MESSAGE, TEMPLATE_QUOTE, POLL_MESSAGE, EPHEMERAL_DURATION_CHANGED, EPHEMERAL_CHANGED, EPHEMERAL_DEFAULT, EPHEMERAL_SAVE, GROUP_CHANGED_ONLY_ADMINS_CAN_SEND, GROUP_CHANGED_ALL_MEMBERS_CAN_SEND, GROUP_CHANGED_ONLY_ADMINS_CAN_EDIT, GROUP_CHANGED_ALL_MEMBERS_CAN_EDIT, GROUP_ONLY_ADMINS_CAN_SEND, CHANGED_NUMBER_TO, CHANGED_NUMBER_CHATTING_WITH_NEW, CHANGED_NUMBER_CHATTING_WITH_OLD, STANDARD_CHAT, SENDER_IN_CONTACTS, BUSINESS_OFFICIAL, GROUP_ADDED_TO_COMMUNITY, COMMUNITY_MANAGEMENT_ACTION, UI_ELEMENTS, UI_ELEMENTS_QUOTE, CHANNEL_ADDED_PRIVACY, CHANNEL_CREATED, ORDER_MESSAGE, UNKNOWN_MESSAGE
TEXT_MESSAGE, IMAGE_MESSAGE, AUDIO_MESSAGE, VIDEO_MESSAGE, UNKNOWN_MEDIA_MESSAGE, CONTACT_MESSAGE, LOCATION_MESSAGE, SHARE_LOCATION_MESSAGE, VOICE_CALL, VIDEO_CALL, APP_MESSAGE, GIF_MESSAGE, BLOCKED_CONTACT, UNBLOCKED_CONTACT, BUSINESS_CHAT, BUSINESS_TO_STANDARD, MESSAGES_ENCRYPTED, MESSAGES_NOW_ENCRYPTED, ENCRYPTION_KEY_CHANGED, MISSED_VOICE_CALL, MISSED_VIDEO_CALL, DELETED_MESSAGE, DELETED_BY_ADMIN, DELETED_BY_SENDER, GROUP_CREATED, USER_JOINED_GROUP, USER_JOINED_GROUP_FROM_LINK, USERS_JOINED_GROUP, USER_LEFT_GROUP, USER_REMOVED_FROM_GROUP, URL_MESSAGE, GROUP_ICON_CHANGED, GROUP_ICON_DELETED, GROUP_DESCRIPTION_CHANGED, SUBJECT_CHANGED, YOU_ADMIN, YOU_NOT_ADMIN, WAITING_MESSAGE, STICKER_MESSAGE, REFUSED_VIDEO_CALL, REFUSED_VOICE_CALL, UNAVAILABLE_VIDEO_CALL, UNAVAILABLE_VOICE_CALL, UNKNOWN_VOICE_CALL, UNKNOWN_VIDEO_CALL, VIEW_ONCE_IMAGE_MESSAGE, VIEW_ONCE_VIDEO_MESSAGE, CALL_MESSAGE, BUSINESS_META_SECURE_SERVICE, GROUP_INVITE, TEMPLATE_MESSAGE, TEMPLATE_QUOTE, POLL_MESSAGE, EPHEMERAL_DURATION_CHANGED, EPHEMERAL_CHANGED, EPHEMERAL_DEFAULT, EPHEMERAL_SAVE, GROUP_CHANGED_ONLY_ADMINS_CAN_SEND, GROUP_CHANGED_ALL_MEMBERS_CAN_SEND, GROUP_CHANGED_ONLY_ADMINS_CAN_EDIT, GROUP_CHANGED_ALL_MEMBERS_CAN_EDIT, GROUP_ONLY_ADMINS_CAN_SEND, CHANGED_NUMBER_TO, CHANGED_NUMBER_CHATTING_WITH_NEW, CHANGED_NUMBER_CHATTING_WITH_OLD, STANDARD_CHAT, SENDER_ADDED_TO_CONTACTS, SENDER_IN_CONTACTS, BUSINESS_OFFICIAL, GROUP_ADDED_TO_COMMUNITY, COMMUNITY_MANAGEMENT_ACTION, UI_ELEMENTS, UI_ELEMENTS_QUOTE, CHANNEL_ADDED_PRIVACY, CHANNEL_CREATED, ORDER_MESSAGE, UNKNOWN_MESSAGE
}

public static enum MessageStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ private synchronized void printMessage(PrintWriter out, Message message, boolean
out.println("<div class=\"systemmessage\">");
out.println(name + " " + Messages.getString("WhatsAppReport.SenderInContacts"));
break;
case SENDER_ADDED_TO_CONTACTS:
out.println("<div class=\"systemmessage\">");
out.println(name + " " + Messages.getString("WhatsAppReport.SenderAddedToContacts"));
break;
case EPHEMERAL_CHANGED:
case EPHEMERAL_DEFAULT:
case EPHEMERAL_DURATION_CHANGED:
Expand Down

0 comments on commit 396e00e

Please sign in to comment.