hangupsjs
hangupsjs copied to clipboard
Get conversation metadata by id
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.
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
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?
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.
From looking at my logs, conversation_state.conversation
isn't null when hangups calls getconversation
.
hm. thanks @tdryer. wonder whether i analyzed a bad conversation.