Skip to content

Commit

Permalink
'#2400: Handle system message type 85 (admin approval to join off).
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Jan 7, 2025
1 parent 6e351b4 commit d7523da
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ WhatsAppReport.GroupChangedAllMembersCanEdit=changed this group's settings to al
WhatsAppReport.GroupChangedOnlyAdminsCanEdit=changed this group's settings to allow only admins to edit this group's info.
WhatsAppReport.GroupChangedAllMembersCanSend=changed this group's settings to allow all participants to send messages.
WhatsAppReport.GroupChangedOnlyAdminsCanSend=changed this group's settings to allow only admins to send messages.
WhatsAppReport.GroupChangedAdminApprovalOff=turned off admin approval to join this group.
WhatsAppReport.GroupOnlyAdminsCanSend=Only admins can send messages to this group.
WhatsAppReport.ChangedDevice=changed device.
WhatsAppReport.ChangedNumberTo=changed to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ WhatsAppReport.GroupChangedAllMembersCanEdit=changed this group's settings to al
WhatsAppReport.GroupChangedOnlyAdminsCanEdit=changed this group's settings to allow only admins to edit this group's info.[TBT]
WhatsAppReport.GroupChangedAllMembersCanSend=changed this group's settings to allow all participants to send messages.[TBT]
WhatsAppReport.GroupChangedOnlyAdminsCanSend=changed this group's settings to allow only admins to send messages.[TBT]
WhatsAppReport.GroupChangedAdminApprovalOff=turned off admin approval to join this group.[TBT]
WhatsAppReport.GroupOnlyAdminsCanSend=Only admins can send messages to this group.[TBT]
WhatsAppReport.ChangedDevice=changed device.[TBT]
WhatsAppReport.ChangedNumberTo=changed to[TBT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ WhatsAppReport.GroupChangedAllMembersCanEdit=changed this group's settings to al
WhatsAppReport.GroupChangedOnlyAdminsCanEdit=changed this group's settings to allow only admins to edit this group's info.[TBT]
WhatsAppReport.GroupChangedAllMembersCanSend=changed this group's settings to allow all participants to send messages.[TBT]
WhatsAppReport.GroupChangedOnlyAdminsCanSend=changed this group's settings to allow only admins to send messages.[TBT]
WhatsAppReport.GroupChangedAdminApprovalOff=turned off admin approval to join this group.[TBT]
WhatsAppReport.GroupOnlyAdminsCanSend=Only admins can send messages to this group.[TBT]
WhatsAppReport.ChangedDevice=changed device.[TBT]
WhatsAppReport.ChangedNumberTo=changed to[TBT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ WhatsAppReport.GroupChangedAllMembersCanEdit=a modifié les paramètres de ce gr
WhatsAppReport.GroupChangedOnlyAdminsCanEdit=a modifié les paramètres de ce groupe pour permettre uniquement aux administrateurs d'effectuer des modifications.
WhatsAppReport.GroupChangedAllMembersCanSend=a modifié les paramètres de ce groupe pour permettre à tous les participants d'envoyer des messages.
WhatsAppReport.GroupChangedOnlyAdminsCanSend=a modifié les paramètres de ce groupe pour autoriser uniquement les administrateurs à envoyer des messages.
WhatsAppReport.GroupChangedAdminApprovalOff=turned off admin approval to join this group.[TBT]
WhatsAppReport.GroupOnlyAdminsCanSend=Seuls les administrateurs peuvent envoyer des messages à ce groupe.
WhatsAppReport.ChangedDevice=a changer d'appareil.
WhatsAppReport.ChangedNumberTo=changé en
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ WhatsAppReport.GroupChangedAllMembersCanEdit=changed this group's settings to al
WhatsAppReport.GroupChangedOnlyAdminsCanEdit=changed this group's settings to allow only admins to edit this group's info.[TBT]
WhatsAppReport.GroupChangedAllMembersCanSend=changed this group's settings to allow all participants to send messages.[TBT]
WhatsAppReport.GroupChangedOnlyAdminsCanSend=changed this group's settings to allow only admins to send messages.[TBT]
WhatsAppReport.GroupChangedAdminApprovalOff=turned off admin approval to join this group.[TBT]
WhatsAppReport.GroupOnlyAdminsCanSend=Only admins can send messages to this group.[TBT]
WhatsAppReport.ChangedDevice=changed device.[TBT]
WhatsAppReport.ChangedNumberTo=changed to[TBT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ WhatsAppReport.GroupChangedAllMembersCanEdit=mudou as configurações deste grup
WhatsAppReport.GroupChangedOnlyAdminsCanEdit=mudou as configurações deste grupo para permitir que somente admins alterem os dados do grupo.
WhatsAppReport.GroupChangedAllMembersCanSend=mudou as configurações deste grupo para permitir que todos os membros enviem mensagens.
WhatsAppReport.GroupChangedOnlyAdminsCanSend=mudou as configurações deste grupo para permitir que somente admins enviem mensagens.
WhatsAppReport.GroupChangedAdminApprovalOff=desativou a autorização de admins para entrar neste grupo.
WhatsAppReport.GroupOnlyAdminsCanSend=Somente admins podem enviar mensagens ao grupo.
WhatsAppReport.ChangedDevice=mudou de dispositivo.
WhatsAppReport.ChangedNumberTo=mudou para
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static iped.parsers.whatsapp.Message.MessageType.GIF_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_ADDED_TO_COMMUNITY;
import static iped.parsers.whatsapp.Message.MessageType.CONTACTED_FIND_BUSINESSES;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_CHANGED_ADMIN_APPROVAL_OFF;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_CHANGED_ALL_MEMBERS_CAN_EDIT;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_CHANGED_ALL_MEMBERS_CAN_SEND;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_CHANGED_ONLY_ADMINS_CAN_ADD;
Expand Down Expand Up @@ -100,15 +101,13 @@
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import iped.parsers.sqlite.SQLite3DBParser;
import iped.parsers.whatsapp.Message.MessageStatus;
import iped.parsers.whatsapp.Message.MessageType;
import iped.parsers.whatsapp.Message.MessageQuotedType;

/**
Expand Down Expand Up @@ -853,6 +852,9 @@ protected Message.MessageType decodeMessageType(int messageType, int status, Int
case 84:
result = NEW_PARTICIPANTS_NEED_ADMIN_APPROVAL;
break;
case 85:
result = GROUP_CHANGED_ADMIN_APPROVAL_OFF;
break;
case 87:
case 88:
case 95:
Expand Down Expand Up @@ -905,7 +907,6 @@ protected Message.MessageType decodeMessageType(int messageType, int status, Int
default:
break;
}

break;
case 1:
result = IMAGE_MESSAGE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ public boolean isSystemMessage() {
case GROUP_CHANGED_ONLY_ADMINS_CAN_ADD:
case GROUP_CHANGED_ONLY_ADMINS_CAN_EDIT:
case GROUP_CHANGED_ONLY_ADMINS_CAN_SEND:
case GROUP_CHANGED_ADMIN_APPROVAL_OFF:
case GROUP_CREATED:
case COMMUNITY_DESCRIPTION_CHANGED:
case GROUP_DESCRIPTION_CHANGED:
Expand All @@ -446,6 +447,7 @@ public boolean isSystemMessage() {
case GROUP_ONLY_ADMINS_CAN_SEND:
case MESSAGES_ENCRYPTED:
case MESSAGES_NOW_ENCRYPTED:
case NEW_PARTICIPANTS_NEED_ADMIN_APPROVAL:
case ORDER_MESSAGE:
case PINNED_MESSAGE:
case SENDER_ADDED_TO_CONTACTS:
Expand Down Expand Up @@ -679,7 +681,7 @@ public void setAddress(String address) {
}

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, DOC_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_ADDED_TO_COMMUNITY, USER_ADDED_TO_GROUP, USER_JOINED_GROUP_FROM_COMMUNITY, USER_JOINED_GROUP_FROM_LINK, USER_JOINED_GROUP_FROM_INVITATION, USER_LEFT_GROUP, USER_REMOVED_FROM_GROUP, USER_COMMUNITY_ADMIN, URL_MESSAGE, GROUP_ICON_CHANGED, GROUP_ICON_DELETED, GROUP_DESCRIPTION_CHANGED, GROUP_DESCRIPTION_DELETED, SUBJECT_CHANGED, YOU_ADMIN, YOU_NOT_ADMIN, USER_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_AUDIO_MESSAGE, 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_SETTINGS_NOT_APPLIED, EPHEMERAL_CHANGED, EPHEMERAL_DEFAULT, EPHEMERAL_SAVE, GROUP_CHANGED_ONLY_ADMINS_CAN_ADD, 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_DEVICE, 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, GROUP_REMOVED_FROM_COMMUNITY, COMMUNITY_MANAGEMENT_ACTION, COMMUNITY_WELCOME, UI_ELEMENTS, UI_ELEMENTS_QUOTE, CHAT_ADDED_PRIVACY, CHANNEL_ADDED_PRIVACY, CHANNEL_CREATED, ORDER_MESSAGE, PRODUCT_MESSAGE, BUSINESS_CHANGED_NAME, USER_JOINED_WHATSAPP, PINNED_MESSAGE, GROUP_NAME_CHANGED, AI_THIRD_PARTY, NEW_PARTICIPANTS_NEED_ADMIN_APPROVAL, RESET_GROUP_LINK, COMMUNITY_RENAMED, ANY_COMMUNITY_MEMBER_CAN_JOIN_GROUP, UNKNOWN_MESSAGE, OVER_256_MEMBERS_ONLY_ADMINS_CAN_EDIT, SECURITY_NOTIFICATIONS_NO_LONGER_AVAILABLE, CONTACTED_FIND_BUSINESSES, COMMUNITY_CHANGED_ONLY_ADMINS_CAN_ADD, COMMUNITY_CHANGED_ALL_MEMBERS_CAN_ADD, COMMUNITY_DESCRIPTION_CHANGED, COMMUNITY_NOT_AVAILABLE, GROUP_NOT_PART_OF_COMMUNITY
TEXT_MESSAGE, IMAGE_MESSAGE, AUDIO_MESSAGE, VIDEO_MESSAGE, UNKNOWN_MEDIA_MESSAGE, CONTACT_MESSAGE, LOCATION_MESSAGE, SHARE_LOCATION_MESSAGE, VOICE_CALL, VIDEO_CALL, DOC_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_ADDED_TO_COMMUNITY, USER_ADDED_TO_GROUP, USER_JOINED_GROUP_FROM_COMMUNITY, USER_JOINED_GROUP_FROM_LINK, USER_JOINED_GROUP_FROM_INVITATION, USER_LEFT_GROUP, USER_REMOVED_FROM_GROUP, USER_COMMUNITY_ADMIN, URL_MESSAGE, GROUP_ICON_CHANGED, GROUP_ICON_DELETED, GROUP_DESCRIPTION_CHANGED, GROUP_DESCRIPTION_DELETED, SUBJECT_CHANGED, YOU_ADMIN, YOU_NOT_ADMIN, USER_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_AUDIO_MESSAGE, 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_SETTINGS_NOT_APPLIED, EPHEMERAL_CHANGED, EPHEMERAL_DEFAULT, EPHEMERAL_SAVE, GROUP_CHANGED_ONLY_ADMINS_CAN_ADD, 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_DEVICE, 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, GROUP_REMOVED_FROM_COMMUNITY, COMMUNITY_MANAGEMENT_ACTION, COMMUNITY_WELCOME, UI_ELEMENTS, UI_ELEMENTS_QUOTE, CHAT_ADDED_PRIVACY, CHANNEL_ADDED_PRIVACY, CHANNEL_CREATED, ORDER_MESSAGE, PRODUCT_MESSAGE, BUSINESS_CHANGED_NAME, USER_JOINED_WHATSAPP, PINNED_MESSAGE, GROUP_NAME_CHANGED, AI_THIRD_PARTY, NEW_PARTICIPANTS_NEED_ADMIN_APPROVAL, RESET_GROUP_LINK, COMMUNITY_RENAMED, ANY_COMMUNITY_MEMBER_CAN_JOIN_GROUP, UNKNOWN_MESSAGE, OVER_256_MEMBERS_ONLY_ADMINS_CAN_EDIT, SECURITY_NOTIFICATIONS_NO_LONGER_AVAILABLE, CONTACTED_FIND_BUSINESSES, COMMUNITY_CHANGED_ONLY_ADMINS_CAN_ADD, COMMUNITY_CHANGED_ALL_MEMBERS_CAN_ADD, COMMUNITY_DESCRIPTION_CHANGED, COMMUNITY_NOT_AVAILABLE, GROUP_NOT_PART_OF_COMMUNITY, GROUP_CHANGED_ADMIN_APPROVAL_OFF
}

public static enum MessageStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,11 @@ private synchronized void printMessage(PrintWriter out, Message message, boolean
out.println("<div class=\"systemmessage\">");
out.println(Messages.getString("WhatsAppReport.ContactedFindBusinesses", name) + "<br>");
break;
case GROUP_CHANGED_ADMIN_APPROVAL_OFF:
out.println("<div class=\"systemmessage\">");
out.print(name + " ");
out.println(Messages.getString("WhatsAppReport.GroupChangedAdminApprovalOff") + "<br>");
break;
case USER_ADMIN:
out.println("<div class=\"systemmessage\">");
out.print(name + " ");
Expand Down

0 comments on commit d7523da

Please sign in to comment.