{"action":"created","issue":{"url":"https://api.github.com/repos/tgalal/yowsup/issues/939","labels_url":"https://api.github.com/repos/tgalal/yowsup/issues/939/labels{/name}","comments_url":"https://api.github.com/repos/tgalal/yowsup/issues/939/comments","events_url":"https://api.github.com/repos/tgalal/yowsup/issues/939/events","html_url":"https://github.com/tgalal/yowsup/issues/939","id":95832032,"number":939,"title":"Echo Client crash new number","user":{"login":"Parnassian","id":1044571,"avatar_url":"https://avatars.githubusercontent.com/u/1044571?v=3","gravatar_id":"","url":"https://api.github.com/users/Parnassian","html_url":"https://github.com/Parnassian","followers_url":"https://api.github.com/users/Parnassian/followers","following_url":"https://api.github.com/users/Parnassian/following{/other_user}","gists_url":"https://api.github.com/users/Parnassian/gists{/gist_id}","starred_url":"https://api.github.com/users/Parnassian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parnassian/subscriptions","organizations_url":"https://api.github.com/users/Parnassian/orgs","repos_url":"https://api.github.com/users/Parnassian/repos","events_url":"https://api.github.com/users/Parnassian/events{/privacy}","received_events_url":"https://api.github.com/users/Parnassian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-07-18T15:15:05Z","updated_at":"2015-07-27T20:41:03Z","closed_at":null,"body":"Just like #937 yowsup crashes when a user sends me a message that has never send me a message.\r\n\r\nI do not have a crash log since I did not enable debugging.\r\n\r\nI used the latest echo client example in the repo.\r\n\r\nWhen I was using the yowsup cli command line tool, the tool also crashed whilst sending a message to someone I never have send a message to. I synced my contactlist with the phonenumber I sent the message too and after that it worked.\r\n\r\nMaybe in the echo client it needs to sync the new contact when it sends a message and than respond to it? If somebody is already doing that please show me how you do it.\r\n\r\nLooking forward to a reply.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/24556021-echo-client-crash-new-number?utm_campaign=plugin&utm_content=tracker%2F298781&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F298781&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/tgalal/yowsup/issues/comments/125336209","html_url":"https://github.com/tgalal/yowsup/issues/939#issuecomment-125336209","issue_url":"https://api.github.com/repos/tgalal/yowsup/issues/939","id":125336209,"user":{"login":"CharlesOkwuagwu","id":1735005,"avatar_url":"https://avatars.githubusercontent.com/u/1735005?v=3","gravatar_id":"","url":"https://api.github.com/users/CharlesOkwuagwu","html_url":"https://github.com/CharlesOkwuagwu","followers_url":"https://api.github.com/users/CharlesOkwuagwu/followers","following_url":"https://api.github.com/users/CharlesOkwuagwu/following{/other_user}","gists_url":"https://api.github.com/users/CharlesOkwuagwu/gists{/gist_id}","starred_url":"https://api.github.com/users/CharlesOkwuagwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharlesOkwuagwu/subscriptions","organizations_url":"https://api.github.com/users/CharlesOkwuagwu/orgs","repos_url":"https://api.github.com/users/CharlesOkwuagwu/repos","events_url":"https://api.github.com/users/CharlesOkwuagwu/events{/privacy}","received_events_url":"https://api.github.com/users/CharlesOkwuagwu/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T20:41:03Z","updated_at":"2015-07-27T20:41:03Z","body":"(my python sucks so... VB.net :) )\r\n\r\n    Function DecodeV2(data As Byte()) As Byte()\r\n        Select Case data.Length\r\n            Case Is < 3 + 128\r\n                Return Slice(data, 2, data.Length - 3)\r\n            Case Is < 3 + (128 * 128)\r\n                Return Slice(data, 3, data.Length - 4)\r\n            Case Else 'messages longer than 16,384 !?!\r\n                Return data\r\n        End Select\r\n    End Function\r\n\r\n    Function EncodeV2(data As Byte()) As Byte()\r\n        Dim len = data.Length\r\n        Dim a = New List(Of Byte)\r\n        a.Add(&HA)\r\n\r\n        If len < 128 Then\r\n            a.Add(CByte(len))\r\n        Else\r\n            Dim v = CShort(len)\r\n            a.Add(CByte((v And &HFF) Or &H80))\r\n            v >>= 7\r\n            a.Add(CByte((v And &HFF)))\r\n        End If\r\n\r\n        a.AddRange(data)\r\n        a.Add(&H1)\r\n\r\n        Return a.ToArray\r\n    End Function"}}