mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 20:40:38 +00:00
reverted listgroups/listcontacts
This commit is contained in:
parent
dfb299297a
commit
84a1bfad26
2 changed files with 6 additions and 32 deletions
|
@ -41,10 +41,6 @@ public interface Signal extends DBusInterface {
|
||||||
|
|
||||||
List<byte[]> getGroupIds();
|
List<byte[]> getGroupIds();
|
||||||
|
|
||||||
List<String> listGroups();
|
|
||||||
|
|
||||||
List<String> listContacts();
|
|
||||||
|
|
||||||
String getGroupName(byte[] groupId);
|
String getGroupName(byte[] groupId);
|
||||||
|
|
||||||
List<String> getGroupMembers(byte[] groupId);
|
List<String> getGroupMembers(byte[] groupId);
|
||||||
|
@ -55,7 +51,7 @@ public interface Signal extends DBusInterface {
|
||||||
|
|
||||||
boolean isRegistered();
|
boolean isRegistered();
|
||||||
|
|
||||||
void updateProfile(String name,String about,String aboutEmoji,String avatarPath,boolean removeAvatar) throws Error.Failure;
|
void updateProfile(String name,String about,String aboutEmoji,String avatarPath,boolean removeAvatar) throws Error.Failure;
|
||||||
|
|
||||||
class MessageReceived extends DBusSignal {
|
class MessageReceived extends DBusSignal {
|
||||||
|
|
||||||
|
|
|
@ -250,42 +250,20 @@ public class DbusSignalImpl implements Signal {
|
||||||
public boolean isRegistered() {
|
public boolean isRegistered() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateProfile(final String name,final String about,final String aboutEmoji, String avatarPath, final boolean removeAvatar) {
|
public void updateProfile(final String name,final String about,final String aboutEmoji, String avatarPath, final boolean removeAvatar) {
|
||||||
try {
|
try {
|
||||||
if (avatarPath.isEmpty()) {
|
if (avatarPath.isEmpty()) {
|
||||||
avatarPath = null;
|
avatarPath = null;
|
||||||
}
|
}
|
||||||
Optional<File> avatarFile = removeAvatar
|
Optional<File> avatarFile = removeAvatar
|
||||||
? Optional.absent()
|
? Optional.absent()
|
||||||
: avatarPath == null ? null : Optional.of(new File(avatarPath));
|
: avatarPath == null ? null : Optional.of(new File(avatarPath));
|
||||||
m.setProfile(name, about, aboutEmoji, avatarFile);
|
m.setProfile(name, about, aboutEmoji, avatarFile);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new Error.Failure(e.getMessage());
|
throw new Error.Failure(e.getMessage());
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> listGroups() {
|
|
||||||
List<GroupInfo> groups = m.getGroups();
|
|
||||||
List<String> gr = new ArrayList<>(groups.size());
|
|
||||||
for (GroupInfo group : groups) {
|
|
||||||
String entry="group="+group.getTitle()+" active:"+group.isMember(m.getSelfAddress())+" blocked:"+group.isBlocked();
|
|
||||||
gr.add(entry);
|
|
||||||
}
|
}
|
||||||
return gr;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> listContacts() {
|
|
||||||
List<ContactInfo> contacts = m.getContacts();
|
|
||||||
List<String> cc = new ArrayList<>(contacts.size());
|
|
||||||
for (ContactInfo c : contacts) {
|
|
||||||
String entry="number:"+c.number+" name:"+c.name+" blocked:"+c.blocked;
|
|
||||||
cc.add(entry);
|
|
||||||
}
|
|
||||||
return cc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue