Skip to content

Commit

Permalink
'#1293: Handle community related system messages: actions 75,88,108,110.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Jan 3, 2024
1 parent d6363db commit addc56f
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ WhatsAppReport.GroupOnlyAdminsCanSend=Only admins can send messages to this grou
WhatsAppReport.ChangedNumber=change to
WhatsAppReport.SenderInContacts=is in 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.
VCardParser.FormattedName=Formatted Name
VCardParser.Name=Name
VCardParser.Nickname=Nickname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ WhatsAppReport.GroupOnlyAdminsCanSend=Only admins can send messages to this grou
WhatsAppReport.ChangedNumber=change to[TBT]
WhatsAppReport.SenderInContacts=is in 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]
VCardParser.FormattedName=Name formatiert
VCardParser.Name=Name
VCardParser.Nickname=Nickname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ WhatsAppReport.GroupOnlyAdminsCanSend=Only admins can send messages to this grou
WhatsAppReport.ChangedNumber=change to[TBT]
WhatsAppReport.SenderInContacts=is in 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]
VCardParser.FormattedName=Nombre con formato
VCardParser.Name=Nombre
VCardParser.Nickname=Sobrenombre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ WhatsAppReport.GroupOnlyAdminsCanSend=Only admins can send messages to this grou
WhatsAppReport.ChangedNumber=change to[TBT]
WhatsAppReport.SenderInContacts=is in 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]
VCardParser.FormattedName=Nome formattato
VCardParser.Name=Nome
VCardParser.Nickname=Nickname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ WhatsAppReport.GroupOnlyAdminsCanSend=Somente admins podem enviar mensagens ao g
WhatsAppReport.ChangedNumber=mudou para
WhatsAppReport.SenderInContacts=está na 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.
VCardParser.FormattedName=Nome Formatado
VCardParser.Name=Nome
VCardParser.Nickname=Apelido
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static iped.parsers.whatsapp.Message.MessageType.BUSINESS_OFFICIAL;
import static iped.parsers.whatsapp.Message.MessageType.CALL_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.CHANGED_NUMBER;
import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_MANAGEMENT_ACTION;
import static iped.parsers.whatsapp.Message.MessageType.CONTACT_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.DELETED_BY_ADMIN;
import static iped.parsers.whatsapp.Message.MessageType.DELETED_BY_SENDER;
Expand All @@ -17,6 +18,7 @@
import static iped.parsers.whatsapp.Message.MessageType.EPHEMERAL_ENABLED;
import static iped.parsers.whatsapp.Message.MessageType.EPHEMERAL_SAVE;
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.GROUP_CHANGED_ALL_MEMBERS_CAN_SEND;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_CHANGED_ONLY_ADMINS_CAN_SEND;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_CREATED;
Expand Down Expand Up @@ -593,9 +595,17 @@ protected Message.MessageType decodeMessageType(int messageType, int status, Int
case 70:
result = CALL_MESSAGE;
break;
case 75:
case 108:
result = GROUP_ADDED_TO_COMMUNITY;
break;
case 80:
result = EPHEMERAL_SAVE;
break;
case 88:
case 110:
result = COMMUNITY_MANAGEMENT_ACTION;
break;
case 129:
result = SENDER_IN_CONTACTS;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public void setSortId(long sortId) {
}

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, 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_ENABLED, EPHEMERAL_SAVE, GROUP_CHANGED_ONLY_ADMINS_CAN_SEND, GROUP_CHANGED_ALL_MEMBERS_CAN_SEND, GROUP_ONLY_ADMINS_CAN_SEND, CHANGED_NUMBER, STANDARD_CHAT, SENDER_IN_CONTACTS, BUSINESS_OFFICIAL, 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, 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_ENABLED, EPHEMERAL_SAVE, GROUP_CHANGED_ONLY_ADMINS_CAN_SEND, GROUP_CHANGED_ALL_MEMBERS_CAN_SEND, GROUP_ONLY_ADMINS_CAN_SEND, CHANGED_NUMBER, STANDARD_CHAT, SENDER_IN_CONTACTS, BUSINESS_OFFICIAL, GROUP_ADDED_TO_COMMUNITY, COMMUNITY_MANAGEMENT_ACTION, UNKNOWN_MESSAGE
}

public static enum MessageStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@ private synchronized void printMessage(PrintWriter out, Message message, boolean
out.print(format(message.getData()) + "<br>"); //$NON-NLS-1$
}
break;
case GROUP_ADDED_TO_COMMUNITY:
out.println("<div class=\"systemmessage\">");
out.println(Messages.getString("WhatsAppReport.GroupAddedToCommunity") + "<br>");
break;
case COMMUNITY_MANAGEMENT_ACTION:
out.println("<div class=\"systemmessage\">");
out.println(Messages.getString("WhatsAppReport.CommunityManagementAction") + "<br>");
break;
case USER_JOINED_GROUP:
case USERS_JOINED_GROUP:
case USER_JOINED_GROUP_FROM_LINK:
Expand Down

0 comments on commit addc56f

Please sign in to comment.