public override async void Show() { base.Show(); try { LCUser user = await LCUser.GetCurrent(); nameText.text = user.GetNickname(); } catch (LCException e) { LCUtils.LogException(e); } }
public async void Decline() { try { await LCFriendship.DeclineRequest(request); SendMessageUpwards("Reload", SendMessageOptions.RequireReceiver); } catch (LCException e) { LCUtils.LogException(e); throw e; } }
public async Task <LCUser> Login(string token) { try { User = await LCUser.BecomeWithSessionToken(token); IMClient = new LCIMClient(User); await IMClient.Open(); return(User); } catch (LCException e) { LCUtils.LogException(e); throw e; } }
public async Task <LCUser> Login(string username, string password) { try { User = await LCUser.Login(username, password); IMClient = new LCIMClient(User); await IMClient.Open(); return(User); } catch (LCException e) { LCUtils.LogException(e); throw e; } }
public async Task Logout() { try { await LCUser.Logout(); LCUtils.RemoveLocalUser(); await IMClient.Close(); User = null; IMClient = null; } catch (LCException e) { LCUtils.LogException(e); } }
public async void Send() { string content = inputField.text; if (string.IsNullOrEmpty(content)) { return; } try { LCIMTextMessage message = new LCIMTextMessage(content); await conversation.Send(message); AddMessage(message); } catch (LCException e) { LCUtils.LogException(e); } }
public async Task <LCUser> Register(string username, string password) { try { LCUser user = new LCUser { Username = username, Password = password }; await user.SignUp(); IMClient = new LCIMClient(user); await IMClient.Open(); return(user); } catch (LCException e) { LCUtils.LogException(e); throw e; } }
public async void Send() { string content = inputField.text; if (string.IsNullOrEmpty(content)) { return; } try { LCIMTextMessage message = new LCIMTextMessage(content); LCIMConversation conversation = await LCManager.Instance.IMClient.GetConversation(WordConversationId); await conversation.Send(message); AddMessage(message); } catch (LCException e) { LCUtils.LogException(e); } }
public async void OnOKClicked() { string nickname = nicknameInputField.text; if (!LCUtils.IsValidString(nickname)) { LCUtils.ShowToast(this, "Please input nickname"); return; } try { LCUser user = await LCUser.GetCurrent(); user.SetNickname(nickname); await user.Save(); SendMessageUpwards("BackToLCMainMenu", SendMessageOptions.RequireReceiver); } catch (LCException e) { LCUtils.LogException(e); LCUtils.ShowToast(this, e); } }