Skip to content

Commit

Permalink
'#1923: Handle system "only admins"/"all" can send (actions 31/32).
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Jan 3, 2024
1 parent f26aab5 commit 9226877
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ WhatsAppReport.EphemeralEnabled=uses a default timer for disappearing messages m
WhatsAppReport.EphemeralSave=Now it is possible to save disappearing message in the chat.
WhatsAppReport.Days=days
WhatsAppReport.Hours=hours
WhatsAppReport.GroupAllMembersCanSend=changed this group's settings to allow all participants to send messages.
WhatsAppReport.GroupOnlyAdminsCanSend=changed this group's settings to allow only admins to send messages.
VCardParser.FormattedName=Formatted Name
VCardParser.Name=Name
VCardParser.Nickname=Nickname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ WhatsAppReport.EphemeralEnabled=uses a default timer for disappearing messages m
WhatsAppReport.EphemeralSave=Now it is possible to save disappearing message in the chat.[TBT]
WhatsAppReport.Hours=hours[TBT]
WhatsAppReport.Days=days[TBT]
WhatsAppReport.GroupAllMembersCanSend=changed this group's settings to allow all participants to send messages.[TBT]
WhatsAppReport.GroupOnlyAdminsCanSend=changed this group's settings to allow only admins to send messages.[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 @@ -274,6 +274,8 @@ WhatsAppReport.EphemeralEnabled=uses a default timer for disappearing messages m
WhatsAppReport.EphemeralSave=Now it is possible to save disappearing message in the chat.[TBT]
WhatsAppReport.Hours=hours[TBT]
WhatsAppReport.Days=days[TBT]
WhatsAppReport.GroupAllMembersCanSend=changed this group's settings to allow all participants to send messages.[TBT]
WhatsAppReport.GroupOnlyAdminsCanSend=changed this group's settings to allow only admins to send messages.[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 @@ -274,6 +274,8 @@ WhatsAppReport.EphemeralEnabled=uses a default timer for disappearing messages m
WhatsAppReport.EphemeralSave=Now it is possible to save disappearing message in the chat.[TBT]
WhatsAppReport.Hours=hours[TBT]
WhatsAppReport.Days=days[TBT]
WhatsAppReport.GroupAllMembersCanSend=changed this group's settings to allow all participants to send messages.[TBT]
WhatsAppReport.GroupOnlyAdminsCanSend=changed this group's settings to allow only admins to send messages.[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 @@ -274,6 +274,8 @@ WhatsAppReport.EphemeralEnabled=usa uma duração padrão para mensagens tempor
WhatsAppReport.EphemeralSave=Agora é possível salvar as mensagens temporárias na conversa.
WhatsAppReport.Hours=horas
WhatsAppReport.Days=dias
WhatsAppReport.GroupAllMembersCanSend=mudou as configurações deste grupo para permitir que todos os membros enviem mensagens.
WhatsAppReport.GroupOnlyAdminsCanSend=mudou as configurações deste grupo para permitir que somente admins enviem mensagens.
VCardParser.FormattedName=Nome Formatado
VCardParser.Name=Nome
VCardParser.Nickname=Apelido
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
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_ALL_MEMBERS_CAN_SEND;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_CREATED;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_DESCRIPTION_CHANGED;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_ICON_CHANGED;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_INVITE;
import static iped.parsers.whatsapp.Message.MessageType.GROUP_ONLY_ADMINS_CAN_SEND;
import static iped.parsers.whatsapp.Message.MessageType.IMAGE_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.LOCATION_MESSAGE;
import static iped.parsers.whatsapp.Message.MessageType.MESSAGES_ENCRYPTED;
Expand Down Expand Up @@ -525,6 +527,12 @@ protected Message.MessageType decodeMessageType(int messageType, int status, Int
case 27:
result = GROUP_DESCRIPTION_CHANGED;
break;
case 31:
result = GROUP_ONLY_ADMINS_CAN_SEND;
break;
case 32:
result = GROUP_ALL_MEMBERS_CAN_SEND;
break;
case 46:
result = BUSINESS_CHAT;
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, POLL_MESSAGE, EPHEMERAL_DURATION_CHANGED, EPHEMERAL_ENABLED, EPHEMERAL_SAVE, 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, POLL_MESSAGE, EPHEMERAL_DURATION_CHANGED, EPHEMERAL_ENABLED, EPHEMERAL_SAVE, GROUP_ONLY_ADMINS_CAN_SEND, GROUP_ALL_MEMBERS_CAN_SEND, UNKNOWN_MESSAGE
}

public static enum MessageStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ private synchronized void printMessage(PrintWriter out, Message message, boolean
out.println("<div class=\"systemmessage\">"); //$NON-NLS-1$
out.println(Messages.getString("WhatsAppReport.YouAdmin")); //$NON-NLS-1$
break;
case GROUP_ALL_MEMBERS_CAN_SEND:
out.println("<div class=\"systemmessage\">");
out.println(name + " " + Messages.getString("WhatsAppReport.GroupAllMembersCanSend") + "<br>");
break;
case GROUP_ONLY_ADMINS_CAN_SEND:
out.println("<div class=\"systemmessage\">");
out.println(name + " " + Messages.getString("WhatsAppReport.GroupOnlyAdminsCanSend") + "<br>");
break;

default:
IItemReader mediaItem = null;
Expand Down

0 comments on commit 9226877

Please sign in to comment.