mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Update libsignal-service-java
This commit is contained in:
parent
1d77153a2b
commit
60ed2c292f
7 changed files with 56 additions and 13 deletions
|
@ -233,6 +233,12 @@
|
|||
"name":"java.lang.Enum",
|
||||
"allDeclaredMethods":true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.Float",
|
||||
"allDeclaredFields":true,
|
||||
"queryAllDeclaredMethods":true,
|
||||
"queryAllDeclaredConstructors":true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.Integer",
|
||||
"allDeclaredFields":true,
|
||||
|
@ -274,6 +280,14 @@
|
|||
{"name":"getSuppressed","parameterTypes":[] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"java.lang.constant.Constable",
|
||||
"queryAllDeclaredMethods":true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.constant.ConstantDesc",
|
||||
"queryAllDeclaredMethods":true
|
||||
},
|
||||
{
|
||||
"name":"java.lang.reflect.Method",
|
||||
"methods":[{"name":"isDefault","parameterTypes":[] }]
|
||||
|
@ -882,7 +896,9 @@
|
|||
"queryAllDeclaredConstructors":true,
|
||||
"methods":[
|
||||
{"name":"angle","parameterTypes":[] },
|
||||
{"name":"colors","parameterTypes":[] },
|
||||
{"name":"endColor","parameterTypes":[] },
|
||||
{"name":"positions","parameterTypes":[] },
|
||||
{"name":"startColor","parameterTypes":[] }
|
||||
]
|
||||
},
|
||||
|
@ -3180,7 +3196,9 @@
|
|||
"fields":[
|
||||
{"name":"angle_"},
|
||||
{"name":"bitField0_"},
|
||||
{"name":"colors_"},
|
||||
{"name":"endColor_"},
|
||||
{"name":"positions_"},
|
||||
{"name":"startColor_"}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -14,7 +14,7 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.github.turasa", "signal-service-java", "2.15.3_unofficial_56")
|
||||
implementation("com.github.turasa", "signal-service-java", "2.15.3_unofficial_57")
|
||||
implementation("com.fasterxml.jackson.core", "jackson-databind", "2.13.3")
|
||||
implementation("com.google.protobuf", "protobuf-javalite", "3.11.4")
|
||||
implementation("org.bouncycastle", "bcprov-jdk15on", "1.70")
|
||||
|
|
|
@ -837,11 +837,13 @@ public record MessageEnvelope(
|
|||
}
|
||||
}
|
||||
|
||||
public record Gradient(Optional<Color> startColor, Optional<Color> endColor, Optional<Integer> angle) {
|
||||
public record Gradient(
|
||||
List<Color> colors, List<Float> positions, Optional<Integer> angle
|
||||
) {
|
||||
|
||||
static Gradient from(SignalServiceTextAttachment.Gradient gradient) {
|
||||
return new Gradient(gradient.getStartColor().map(Color::new),
|
||||
gradient.getEndColor().map(Color::new),
|
||||
return new Gradient(gradient.getColors().stream().map(Color::new).toList(),
|
||||
gradient.getPositions(),
|
||||
gradient.getAngle());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,16 @@ public class ServiceConfig {
|
|||
public static final AccountAttributes.Capabilities capabilities;
|
||||
|
||||
static {
|
||||
capabilities = new AccountAttributes.Capabilities(false, true, false, true, true, true, true, false, false);
|
||||
capabilities = new AccountAttributes.Capabilities(false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false);
|
||||
|
||||
try {
|
||||
TrustStore contactTrustStore = new IasTrustStore();
|
||||
|
|
|
@ -262,11 +262,6 @@ public final class ProfileHelper {
|
|||
return now - profile.getLastUpdateTimestamp() >= 6 * 60 * 60 * 1000;
|
||||
}
|
||||
|
||||
private SignalServiceProfile retrieveProfileSync(String username) throws IOException {
|
||||
final var locale = Utils.getDefaultLocale(Locale.US);
|
||||
return dependencies.getMessageReceiver().retrieveProfileByUsername(username, Optional.empty(), locale);
|
||||
}
|
||||
|
||||
private Profile decryptProfileAndDownloadAvatar(
|
||||
final RecipientId recipientId, final ProfileKey profileKey, final SignalServiceProfile encryptedProfile
|
||||
) {
|
||||
|
|
|
@ -135,4 +135,8 @@ public class RecipientHelper {
|
|||
}
|
||||
return uuid;
|
||||
}
|
||||
|
||||
private ACI getRegisteredUserByUsername(String username) throws IOException {
|
||||
return dependencies.getAccountManager().getAciByUsername(username);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import org.asamk.signal.manager.api.Color;
|
|||
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||
import org.asamk.signal.manager.groups.GroupId;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
record JsonStoryMessage(
|
||||
boolean allowsReplies,
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
||||
|
@ -40,11 +42,24 @@ record JsonStoryMessage(
|
|||
textAttachment.backgroundColor().map(Color::toHexColor).orElse(null));
|
||||
}
|
||||
|
||||
public record Gradient(String startColor, String endColor, Integer angle) {
|
||||
public record Gradient(
|
||||
String startColor,
|
||||
String endColor,
|
||||
List<String> colors,
|
||||
List<Float> positions,
|
||||
Integer angle
|
||||
) {
|
||||
|
||||
static Gradient from(MessageEnvelope.Story.TextAttachment.Gradient gradient) {
|
||||
return new Gradient(gradient.startColor().map(Color::toHexColor).orElse(null),
|
||||
gradient.endColor().map(Color::toHexColor).orElse(null),
|
||||
final var isLegacyGradient = gradient.colors().size() == 2
|
||||
&& gradient.positions().size() == 2
|
||||
&& gradient.positions().get(0) == 0f
|
||||
&& gradient.positions().get(1) == 1f;
|
||||
|
||||
return new Gradient(isLegacyGradient ? gradient.colors().get(0).toHexColor() : null,
|
||||
isLegacyGradient ? gradient.colors().get(1).toHexColor() : null,
|
||||
gradient.colors().stream().map(Color::toHexColor).toList(),
|
||||
gradient.positions(),
|
||||
gradient.angle().orElse(null));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue