AsamK / signal-cli

signal-cli provides an unofficial commandline, JSON-RPC and dbus interface for the Signal messenger.
GNU General Public License v3.0
3.22k stars 306 forks source link

Can't retrive group member info via listGroups #1534

Closed kareldonk closed 5 months ago

kareldonk commented 6 months ago

When a new member gets added to the group, and the member is not a contact of the registered Signal account and has never exchanged messages with it, it does not seem to be possible to get the name / profile of the new member. Listing the group info with listGroups returns something like the following:

{
    "jsonrpc": "2.0",
    "result": [
        {
            "id": "HP...",
            "name": "NAME",
                        <Snip>
            "members": [
                {
                    "number": "NUMBER",
                    "uuid": "64c..."
                },
                {
                    "number": "NUMBER",
                    "uuid": "41d..."
                },
                {
                    "number": null,
                    "uuid": "d59..."
                }
            ],
            "pendingMembers": [],
            "requestingMembers": [],
            "admins": [
                {
                    "number": "NUMBER",
                    "uuid": "41d..."
                }
            ],
            "banned": [],
            "permissionAddMember": "EVERY_MEMBER",
            "permissionEditDetails": "EVERY_MEMBER",
            "permissionSendMessage": "EVERY_MEMBER",
            "groupInviteLink": null
        }
    ],
    "id": "1591230553"
}

The user with UUID d59... was the one added. But as you can see the number is null and no other data is available. Using a listContacts RPC call right after the above does NOT show that user in the list. I think obviously because that user has never initiated a conversation with the registered Signal account in signal-cli.

So my question is, how can I get more info about the group member via the signal-cli RPC deamon? Obviously it should be possible, because when using the official Signal client, and you are a member of a group, you can see some profile info for the members in the group even if they are not your contacts and you have never chatted with them directly.

One of the problems I have with not being able to get some basic profile info for the newly added user is that if someone in the group mentions them in a message, I can't lookup the mentioned user's name to replace it in the message.

AsamK commented 5 months ago

listContacts has a parameter --all-recipients to include all known recipients and also a parameter to filter for one or multiple recipients by number or uuid. For JSON-RPC that's "params":{"recipient":"d59...","all-recipients":true}.

kareldonk commented 5 months ago

Thank you that worked in my case.