Skip to content

Commit

Permalink
Update MessageContainer.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Darker935 authored Jun 26, 2024
1 parent 9498b85 commit 4708fbe
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public record MessageContainer(
Optional<FutureMessageContainer> editedMessage,
@ProtobufProperty(index = 59, type = ProtobufType.OBJECT)
Optional<FutureMessageContainer> viewOnceV2ExtensionMessage,
@ProtobufProperty(index = 63, type = ProtobufType.OBJECT)
Optional<PinInChatMessage> pinInChatMessage,
@ProtobufProperty(index = 78, type = ProtobufType.OBJECT)
Optional<NewsletterAdminInviteMessage> newsletterAdminInviteMessage,
@ProtobufProperty(index = 35, type = ProtobufType.OBJECT)
Expand Down Expand Up @@ -210,6 +212,7 @@ public static <T extends Message> MessageContainerBuilder ofBuilder(T message) {
builder.pollCreationMessage(Optional.of(pollCreationMessage));
case PollUpdateMessage pollUpdateMessage -> builder.pollUpdateMessage(Optional.of(pollUpdateMessage));
case KeepInChatMessage keepInChatMessage -> builder.keepInChatMessage(Optional.of(keepInChatMessage));
case PinInChatMessage pinInChatMessage -> builder.pinInChatMessage(Optional.of(pinInChatMessage));
case RequestPhoneNumberMessage requestPhoneNumberMessage ->
builder.requestPhoneNumberMessage(Optional.of(requestPhoneNumberMessage));
case EncryptedReactionMessage encReactionMessage ->
Expand Down Expand Up @@ -420,6 +423,9 @@ public Message content() {
if (keepInChatMessage.isPresent()) {
return keepInChatMessage.get();
}
if (pinInChatMessage.isPresent()) {
return pinInChatMessage.get();
}
if (documentWithCaptionMessage.isPresent()) {
return documentWithCaptionMessage.get().unbox();
}
Expand Down Expand Up @@ -668,4 +674,4 @@ public boolean isEmpty() {
public String toString() {
return Objects.toString(content());
}
}
}

0 comments on commit 4708fbe

Please sign in to comment.