mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-04 05:00:39 +00:00
implement Dbus updateProfile with givenName
two versions of updateProfile implemented: - one with givenName and familyName - one with just name update documentation
This commit is contained in:
parent
982e887c9f
commit
766a51c78a
3 changed files with 32 additions and 3 deletions
|
@ -52,12 +52,15 @@ updateGroup(groupId<ay>, newName<s>, members<as>, avatar<s>) -> groupId<ay>::
|
||||||
|
|
||||||
Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound
|
Exceptions: AttachmentInvalid, Failure, InvalidNumber, GroupNotFound
|
||||||
|
|
||||||
updateProfile(newName<s>, about <s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
|
updateProfile(name<s>, about<s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
|
||||||
* newName : New name for your own profile (empty if unchanged)
|
updateProfile(givenName<s>, familyName<s>, about<s>, aboutEmoji <s>, avatar<s>, remove<b>) -> <>::
|
||||||
|
* name : Name for your own profile (empty if unchanged)
|
||||||
|
* givenName : Given name for your own profile (empty if unchanged)
|
||||||
|
* familyName : Family name for your own profile (empty if unchanged)
|
||||||
* about : About message for profile (empty if unchanged)
|
* about : About message for profile (empty if unchanged)
|
||||||
* aboutEmoji : Emoji for profile (empty if unchanged)
|
* aboutEmoji : Emoji for profile (empty if unchanged)
|
||||||
* avatar : Filename of avatar picture for profile (empty if unchanged)
|
* avatar : Filename of avatar picture for profile (empty if unchanged)
|
||||||
* remove : Set to 1 if the existing avatar picture should be removed
|
* remove : Set to true if the existing avatar picture should be removed
|
||||||
|
|
||||||
Exceptions: Failure
|
Exceptions: Failure
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,10 @@ public interface Signal extends DBusInterface {
|
||||||
|
|
||||||
boolean isRegistered();
|
boolean isRegistered();
|
||||||
|
|
||||||
|
void updateProfile(
|
||||||
|
String givenName, String familyName, String about, String aboutEmoji, String avatarPath, boolean removeAvatar
|
||||||
|
) throws Error.Failure;
|
||||||
|
|
||||||
void updateProfile(
|
void updateProfile(
|
||||||
String name, String about, String aboutEmoji, String avatarPath, boolean removeAvatar
|
String name, String about, String aboutEmoji, String avatarPath, boolean removeAvatar
|
||||||
) throws Error.Failure;
|
) throws Error.Failure;
|
||||||
|
|
|
@ -393,6 +393,28 @@ public class DbusSignalImpl implements Signal {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProfile(
|
||||||
|
final String givenName,
|
||||||
|
final String familyName,
|
||||||
|
final String about,
|
||||||
|
final String aboutEmoji,
|
||||||
|
String avatarPath,
|
||||||
|
final boolean removeAvatar
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
if (avatarPath.isEmpty()) {
|
||||||
|
avatarPath = null;
|
||||||
|
}
|
||||||
|
Optional<File> avatarFile = removeAvatar
|
||||||
|
? Optional.absent()
|
||||||
|
: avatarPath == null ? null : Optional.of(new File(avatarPath));
|
||||||
|
m.setProfile(givenName, familyName, about, aboutEmoji, avatarFile);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new Error.Failure(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateProfile(
|
public void updateProfile(
|
||||||
final String name,
|
final String name,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue