{"action":"closed","issue":{"url":"https://api.github.com/repos/PkayJava/MBaaS/issues/47","repository_url":"https://api.github.com/repos/PkayJava/MBaaS","labels_url":"https://api.github.com/repos/PkayJava/MBaaS/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/PkayJava/MBaaS/issues/47/comments","events_url":"https://api.github.com/repos/PkayJava/MBaaS/issues/47/events","html_url":"https://github.com/PkayJava/MBaaS/issues/47","id":154288884,"number":47,"title":"chatting feature : COMMAND_GROUP_INITIATE","user":{"login":"PkayJava","id":872686,"avatar_url":"https://avatars.githubusercontent.com/u/872686?v=3","gravatar_id":"","url":"https://api.github.com/users/PkayJava","html_url":"https://github.com/PkayJava","followers_url":"https://api.github.com/users/PkayJava/followers","following_url":"https://api.github.com/users/PkayJava/following{/other_user}","gists_url":"https://api.github.com/users/PkayJava/gists{/gist_id}","starred_url":"https://api.github.com/users/PkayJava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PkayJava/subscriptions","organizations_url":"https://api.github.com/users/PkayJava/orgs","repos_url":"https://api.github.com/users/PkayJava/repos","events_url":"https://api.github.com/users/PkayJava/events{/privacy}","received_events_url":"https://api.github.com/users/PkayJava/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-11T16:40:40Z","updated_at":"2016-05-16T01:40:09Z","closed_at":"2016-05-16T01:40:09Z","body":"look at ServerHandler.java, this handler should handle this command COMMAND_GROUP_INITIATE\r\n\r\nchat client will use this command start the chat conversation with his friend. client will send this the following text,  for example \r\n\r\nGROUP_INITIATE {userId}\r\n\r\n{userId} is represent who that he want to chat with.\r\n\r\nwhat you need to do is create a conversation record (table conversation), and save these guy into participant table, and reference to that created conversion,\r\n\r\nin real practise,\r\n\r\nsuppose we have 2 users, visa and dota,\r\nvisa want to chat to dota. first visa need to initiate the conversion with dota first.\r\n\r\nvisa will send the following message to server\r\nGROUP_INITIATE dota\r\n\r\nserver will\r\n- create a record in table conversion.\r\n- create two record and put it into table participant. one is dota, one is visa\r\n\r\nthis conversion will keep for a very long time, \r\n\r\nsome time later, when visa want chat with dota again, the same process will repeat, but this time, because the old conversion between both of them is still there, then we don't create conversion record and participant record."}}