/// <summary> /// Retrieves a list of channels, which user has joined /// </summary> public void GetMyChannels(ChatChannelsCallback callback, IClientSocket connection) { if (!connection.IsConnected) { callback.Invoke(new List <string>(), "Not connected"); return; } connection.SendMessage((short)MsfOpCodes.GetCurrentChannels, (status, response) => { if (status != ResponseStatus.Success) { callback.Invoke(new List <string>(), response.AsString("Unknown error")); return; } var list = new List <string>().FromBytes(response.AsBytes()); callback.Invoke(list, null); }); }
/// <summary> /// Retrieves a list of channels, which user has joined /// </summary> public void GetMyChannels(ChatChannelsCallback callback, IClientSocket connection) { if (!connection.IsConnected) { callback.Invoke(new List <ChatChannelInfo>(), "Not connected"); return; } connection.SendMessage((short)MstMessageCodes.GetCurrentChannels, (status, response) => { if (status != ResponseStatus.Success) { callback.Invoke(new List <ChatChannelInfo>(), response.AsString("Unknown error")); return; } var data = response.Deserialize(new ChatChannelsListPacket()); callback.Invoke(data.Channels, null); }); }
/// <summary> /// Retrieves a list of channels, which user has joined /// </summary> public void GetJoinedChannels(ChatChannelsCallback callback, ErrorCallback errorCallback) { if (!Client.IsConnected) { errorCallback.Invoke("Not connected"); return; } Client.SendMessage((ushort)OpCodes.GetCurrentChannels, (status, response) => { if (status != ResponseStatus.Success) { errorCallback.Invoke(response.AsString("Unknown error")); return; } var list = new List <string>().FromBytes(response.AsBytes()); callback.Invoke(list); }); }
/// <summary> /// Retrieves a list of channels, which user has joined /// </summary> /// <param name="callback"></param> public void GetMyChannels(ChatChannelsCallback callback) { GetMyChannels(callback, Connection); }