hangupsjs icon indicating copy to clipboard operation
hangupsjs copied to clipboard

Get conversation metadata by id

Open timvdalen opened this issue 9 years ago • 5 comments

getconversation seems to always return null for conversation_state.conversation, which I would expect to have the metadata for a conversation.

It looks like it's possible to piece together the current state by looking all the events in order, but I would like to be able to get the metadata in one call.

timvdalen avatar Sep 28 '15 09:09 timvdalen

I've investigated the data we get in the response and it seems this data simply isn't part of the response we get in this request.

In protojson it looks like this:

["cgcrp",[1,,"","-6828010704842066541",1443439580969000]
,[["Ugx_nQMJbg40bN8Eprh4AaABAQ"]
,,[[["Ugx_nQMJbg40bN8Eprh4AaABAQ"]                      <------ ,, is where it's missing
,["110994664963851875523","110994664963851875523"]

To double check, I switched off protojson-parsing and run with straight json:

{ response_header: 
   { status: 'OK',
     debug_url: '',
     request_trace_id: '7896078147714378008',
     current_server_time: '1443439436624000' },
  conversation_state: 
   { conversation_id: { id: 'Ugx_nQMJbg40bN8Eprh4AaABAQ' },
     event: [...                                      <---------- data missing here

So it seems you need to talk to google about this :D

algesten avatar Sep 28 '15 11:09 algesten

Too bad. Do you know of any other way to get this data, or should I just grab the list of active conversations and loop through it?

timvdalen avatar Sep 28 '15 12:09 timvdalen

I suspect the way google sees this is that you get the "starting point" state both when you first connect (available in client.init) and when you do a syncrecentconversations. The latter is used when you drop connection for say 45 seconds and need to get a new starting point state.

You're probably supposed to incrementally maintain these states as new events drop in once you're connected though.

algesten avatar Sep 28 '15 14:09 algesten

From looking at my logs, conversation_state.conversation isn't null when hangups calls getconversation.

tdryer avatar Sep 29 '15 02:09 tdryer

hm. thanks @tdryer. wonder whether i analyzed a bad conversation.

algesten avatar Sep 29 '15 05:09 algesten