{"push_id":2957576506,"size":1,"distinct_size":1,"ref":"refs/heads/lesson-22","head":"5929e7c260ebc9ab8b3ce8df01b88aa1ca4d4bf8","before":"2d6a847c68b5279b42909e68417f1a801aeef69c","commits":[{"sha":"5929e7c260ebc9ab8b3ce8df01b88aa1ca4d4bf8","author":{"name":"Sebastian Horatiu","email":"18b3b02b39454404a98e48c9abc535fd782b9439@yahoo.com"},"message":"End of lesson 22. Implemented the creation of a new channel using web sockets. When you tap on the Create Channel button in the AddChannelVC, the SocketService.instance.addChannel is called with the channel name and channel description. This function will then emit and event called 'newChannel' with the channel name and description. The web API has a corresponding on('newChannel'... method that will pick up this event, will create the new channel in the mongoDB and if that completes successfully, a 'channelCreated' event. Back on the mobile app we have a method (SocketService.instance.getChannel) listening for the 'channelCreated' event, called in the ChannleVC view controller, in the viewDidLoad(). This will pick uo the 'channelCreated' event, create new instance of Channel and append it to the channels[] in the MessageService and then it will reload the data found in the table view, thus showing the newly created channel. The newly created channel will also show up in the Channels section of any other user using the app.","distinct":true,"url":"https://api.github.com/repos/sebastianhoratiu/Smack/commits/5929e7c260ebc9ab8b3ce8df01b88aa1ca4d4bf8"}]}
{"actor":{"display_login":"sebastianhoratiu"}}