Skip to content

Commit

Permalink
'#2375: Handle group/community messages (group events 41/43/61).
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Dec 2, 2024
1 parent 7db6f53 commit cb45902
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=This business account changed its name.
WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.
WhatsAppReport.GroupAddedToCommunity=Group was added to the community
WhatsAppReport.GroupRemovedFromCommunity=Group was removed from the community
WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.
WhatsAppReport.CommunityNotAvailable=This community is not available anymore
WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Anyone in the community can join this group.
WhatsAppReport.CommunityManagementAction=Community management action.
WhatsAppReport.CommunityRenamed=changed the community's name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=This business account changed its name.[TBT]
WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT]
WhatsAppReport.GroupAddedToCommunity=Group was added to the community[TBT]
WhatsAppReport.GroupRemovedFromCommunity=Group was removed from the community[TBT]
WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.[TBT]
WhatsAppReport.CommunityNotAvailable=This community is not available anymore[TBT]
WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Any community member can join this group.[TBT]
WhatsAppReport.CommunityManagementAction=Community management action.[TBT]
WhatsAppReport.CommunityRenamed=changed the community's name[TBT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=This business account changed its name.[TBT]
WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT]
WhatsAppReport.GroupAddedToCommunity=Group was added to the community[TBT]
WhatsAppReport.GroupRemovedFromCommunity=Group was removed from the community[TBT]
WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.[TBT]
WhatsAppReport.CommunityNotAvailable=This community is not available anymore[TBT]
WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Cualquier miembro de la comunidad puede unirse a este grupo.
WhatsAppReport.CommunityManagementAction=Community management action.[TBT]
WhatsAppReport.CommunityRenamed=cambió el nombre de la comunidad
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=Ce compte professionnel a changé de nom.
WhatsAppReport.ChatBusinessOfficial=Ce chat est avec un compte professionnel officiel.
WhatsAppReport.GroupAddedToCommunity=Le groupe a été ajouté à la communauté.
WhatsAppReport.GroupRemovedFromCommunity=Le groupe a été supprimé de la communauté.
WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.[TBT]
WhatsAppReport.CommunityNotAvailable=This community is not available anymore[TBT]
WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=N'importe qui dans la communauté peut rejoindre ce groupe.
WhatsAppReport.CommunityManagementAction=Gestion de la communauté.
WhatsAppReport.CommunityRenamed=Changer le nom de la communauté
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=This business account changed its name.[TBT]
WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT]
WhatsAppReport.GroupAddedToCommunity=Group was added to the community[TBT]
WhatsAppReport.GroupRemovedFromCommunity=Group was removed from the community[TBT]
WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.[TBT]
WhatsAppReport.CommunityNotAvailable=This community is not available anymore[TBT]
WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Any community member can join this group.[TBT]
WhatsAppReport.CommunityManagementAction=Community management action.[TBT]
WhatsAppReport.CommunityRenamed=changed the community's name[TBT]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=Esta conta comercial mudou seu nome.
WhatsAppReport.ChatBusinessOfficial=Você está conversando com uma conta comercial oficial.
WhatsAppReport.GroupAddedToCommunity=Grupo foi adicionado a comunidade
WhatsAppReport.GroupRemovedFromCommunity=Grupo foi removido da comunidade
WhatsAppReport.GroupNotPartOfCommunity=Este grupo não faz mais parte da comunidade.
WhatsAppReport.CommunityNotAvailable=Esta comunidade não está mais disponível
WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Todos os membros da comunidade podem entrar neste grupo.
WhatsAppReport.CommunityManagementAction=Ação de gerenciamento de comunidade.
WhatsAppReport.CommunityRenamed=mudou o nome da comunidade
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_CHANGED_ALL_MEMBERS_CAN_ADD;
import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_DESCRIPTION_CHANGED;
import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_MANAGEMENT_ACTION;
import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_NOT_AVAILABLE;
import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_WELCOME;
import static iped.parsers.whatsapp.Message.MessageType.CONTACT_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.DELETED_BY_SENDER;
Expand All @@ -37,6 +38,7 @@
import static iped.parsers.whatsapp.Message.MessageType.GROUP_ICON_DELETED;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_INVITE;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_NAME_CHANGED;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_NOT_PART_OF_COMMUNITY;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_REMOVED_FROM_COMMUNITY;
import static iped.parsers.whatsapp.Message.MessageType.IMAGE_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.LOCATION_MESSAGE;
Expand Down Expand Up @@ -1462,6 +1464,10 @@ protected Message.MessageType decodeMessageType(int messageType, int gEventType,
result = GROUP_CREATED;
break;

case 13:
result = COMMUNITY_NOT_AVAILABLE;
break;

case 15:
result = USER_JOINED_GROUP_FROM_LINK;
break;
Expand Down Expand Up @@ -1503,6 +1509,7 @@ protected Message.MessageType decodeMessageType(int messageType, int gEventType,
break;

case 31:
case 61:
result = GROUP_ADDED_TO_COMMUNITY;
break;

Expand All @@ -1518,6 +1525,10 @@ protected Message.MessageType decodeMessageType(int messageType, int gEventType,
result = GROUP_CHANGED_ONLY_ADMINS_CAN_ADD;
break;

case 43:
result = GROUP_NOT_PART_OF_COMMUNITY;
break;

case 50:
// multiple users added to group
result = USER_ADDED_TO_GROUP;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,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
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
}

public static enum MessageStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,14 @@ private synchronized void printMessage(PrintWriter out, Message message, boolean
}
out.println("<br>");
break;
case COMMUNITY_NOT_AVAILABLE:
out.println("<div class=\"systemmessage\">");
out.println(name + " " + Messages.getString("WhatsAppReport.CommunityNotAvailable") + ".<br>");
break;
case GROUP_NOT_PART_OF_COMMUNITY:
out.println("<div class=\"systemmessage\">");
out.println(name + " " + Messages.getString("WhatsAppReport.GroupNotPartOfCommunity") + ".<br>");
break;
case COMMUNITY_RENAMED:
out.println("<div class=\"systemmessage\">");
out.println(name + " " + Messages.getString("WhatsAppReport.CommunityRenamed") + ".<br>");
Expand Down

0 comments on commit cb45902

Please sign in to comment.