ammgws / hangouts_client

Class for sending/receiving messages on Google Hangouts
0 stars 1 forks source link

Send by name vs Send by JID #1

Open ammgws opened 7 years ago

ammgws commented 7 years ago

In order to specify which conact(s) to send a message to, you need to know their JID, which is in the form of @public.talk.google.com. However this info isn't shown in Hangouts itself, so in order to get this info you would need to run HangoutsClient and get this info manually, which isnt great.

However, we can get the contact's full name from their entry in XMPP roster. Thus to make HangoutsClient more user friendly we can allow recipients to be given by name and then find which entry in the XMPP roster contains that name. (Note that 'name' is not guaranteed to be unique in any given roster.)

TO DO regarding this issue: 1) Add "send by name" functionality (I've already kludged this ability into the code, but it needs a rewrite.) 2) Decide on how "send by name" and "send by JID" should be implemented e.g. Handle it using one methods:
hangouts.send(recipients, by_name=True) OR Have two different methods: hangouts.send_by_JID(recipients), hangouts.send_by_name(recipients)

P.S. XMPP roster format:

{
'r238dsaf9u8sd89f@public.talk.google.com': {
    'name': 'Full Name',
    'groups': [],
    'from': True,
    'to': True,
    'pending_in': False,
    'pending_out': False,
    'whitelisted': False,
    'subscription': 'both'},
}