Skip to content

Instantly share code, notes, and snippets.

@gotascii
Created May 17, 2012 23:17
Show Gist options
  • Save gotascii/2722222 to your computer and use it in GitHub Desktop.
Save gotascii/2722222 to your computer and use it in GitHub Desktop.
def self.convert_response_to_thread_ids(response)
result = {}
result[:threaded_extended] = {}
if response == nil
result[:messages] = []
result[:have_older_msgs] = false
else
threads = []
messages = response[:json].fetch("messages", [])
messages.each do |m|
thread_id = m.fetch("threadId")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment