private void onLoad() { new Thread(() => { Thread.CurrentThread.IsBackground = true; if (DependencyService.Get <ISpixiCodecInfo>().getSupportedAudioCodecs().Count > 0 && !friend.bot) { Utils.sendUiCommand(webView, "showCallButton", ""); } loadApps(); }).Start(); // Execute timer-related functionality immediately updateScreen(); loadMessages(); if (FriendList.getUnreadMessageCount() == 0) { DependencyService.Get <IPushService>().clearNotifications(); } // Set the last message as read friend.setLastRead(); Node.refreshAppRequests = true; }
public override void onResume() { base.onResume(); if (FriendList.getUnreadMessageCount() == 0) { DependencyService.Get <IPushService>().clearNotifications(); } updateMessagesReadStatus(); }
// Executed every second public override void updateScreen() { Logging.info("Updating chat"); Utils.sendUiCommand(webView, "setNickname", friend.nickname); if (friend.online) { Utils.sendUiCommand(webView, "showIndicator", "true"); } else { Utils.sendUiCommand(webView, "showIndicator", "false"); } // Show connectivity warning bar if (StreamClientManager.isConnectedTo(node_ip) == null) { if (connectedToNode == true) { connectedToNode = false; Utils.sendUiCommand(webView, "showWarning", "Not connected to S2 node"); } } else { if (connectedToNode == false) { connectedToNode = true; Utils.sendUiCommand(webView, "showWarning", ""); } } // Show the messages indicator int msgCount = FriendList.getUnreadMessageCount(); if (msgCount != lastMessageCount) { lastMessageCount = msgCount; //webView.Eval(string.Format("showUnread({0})", lastMessageCount)); } }
// Executed every second public override void updateScreen() { base.updateScreen(); Utils.sendUiCommand(webView, "setNickname", friend.nickname); if (friend.online) { Utils.sendUiCommand(webView, "showIndicator", "true"); } else { Utils.sendUiCommand(webView, "showIndicator", "false"); } // Show connectivity warning bar if (NetworkClientManager.getConnectedClients(true).Count() > 0) { if (!Config.enablePushNotifications && StreamClientManager.isConnectedTo(friend.searchForRelay()) == null) { Utils.sendUiCommand(webView, "showWarning", "Connecting to Ixian S2..."); } else { Utils.sendUiCommand(webView, "showWarning", ""); } } else { Utils.sendUiCommand(webView, "showWarning", "Connecting to Ixian DLT..."); } // Show the messages indicator int msgCount = FriendList.getUnreadMessageCount(); if (msgCount != lastMessageCount) { lastMessageCount = msgCount; //webView.Eval(string.Format("showUnread({0})", lastMessageCount)); } }
// Executed every second private void onTimer() { if (friend.online) { webView.Eval("showIndicator(true)"); } else { webView.Eval("showIndicator(false)"); } // Show connectivity warning bar if (StreamClientManager.isConnectedTo(node_ip) == null) { if (connectedToNode == true) { connectedToNode = false; webView.Eval("showWarning('Not connected to S2 node')"); } } else { if (connectedToNode == false) { connectedToNode = true; webView.Eval("showWarning('')"); } } // Show the messages indicator int msgCount = FriendList.getUnreadMessageCount(); if (msgCount != lastMessageCount) { lastMessageCount = msgCount; webView.Eval(string.Format("showUnread({0})", lastMessageCount)); } }