Exemplo n.º 1
0
 public void SendNotification(string idType, int id, ClientNotification data)
 {
     this.SendNotification(data.NotificationName, idType, new PyList(1)
     {
         [0] = id
     }, data.GetElements());
 }
Exemplo n.º 2
0
        /// <summary>Send the event to the client for display.</summary>
        /// <param name="logEvent">Describes the event.</param>
        protected override void Write(LogEventInfo logEvent)
        {
            // Could do some preprocessing here...

            var slog = Layout.Render(logEvent);

            ClientNotification?.Invoke(logEvent.Level, slog);
        }
Exemplo n.º 3
0
        public void NotifyCharacter(int characterID, ClientNotification entry)
        {
            // do not waste network resources on useless notifications
            if (this.CharacterManager.IsCharacterConnected(characterID) == false)
            {
                return;
            }

            // build a proper notification for this
            this.SendNotification(entry.NotificationName, NOTIFICATION_TYPE_CHARACTER, characterID, entry.GetElements());
        }
Exemplo n.º 4
0
 public override void execute(BRemote __byps__remote, BAsyncResultIF <Object> __byps__asyncResult)
 {
     // checkpoint byps.gen.cs.GenApiClass:406
     try {
         ClientNotification __byps__remoteT = (ClientNotification)__byps__remote;
         BAsyncResultSendMethod <Object> __byps__outerResult = new BAsyncResultSendMethod <Object>(__byps__asyncResult, new EloixClient.IndexServer.BResult_19());
         __byps__remoteT.updateTask(ciValue, userTaskValue, notifyTypeValue, BAsyncResultHelper.ToDelegate(__byps__outerResult));
     } catch (Exception e) {
         __byps__asyncResult.setAsyncResult(null, e);
     }
 }
		private static async Task SetServerBadgeCount(int count)
		{
			if (DonkyCore.Instance.IsInitialised && await DonkyCore.Instance.RegistrationController.GetIsRegisteredAsync())
			{
				var notification = new ClientNotification
					{
						{"type", "SetBadgeCount"},
						{"badgeCount", count}
					};

				await DonkyCore.Instance.GetService<INotificationManager>().SendClientNotificationsAsync(notification);
			}
		}
Exemplo n.º 6
0
        public ClientNotification GetClientNotifications(string clientId)
        {
            ClientNotification result = null;

            if (clientNotificationrDict == null)
            {
                //Logger.Instance.Error(this, string.Format("GetClientNotifications application state error: clientNotificationrDict is null. clientid:{0}", clientId));
                return(result);
            }

            if (clientNotificationrDict.ContainsKey(clientId))
            {
                clientNotificationrDict.TryGetValue(clientId, out result);
            }
            return(result);
        }
		private ClientNotification CreateMessageReadNotification(Message message)
		{
			var notification = new ClientNotification
			{
				{"type", "MessageRead"},
				{"senderInternalUserId", message.SenderInternalUserId},
				{"messageId", message.MessageId},
				{"senderMessageId", message.SenderMessageId},
				{"messageType", message.MessageType},
				{"messageScope", message.MessageScope},
				{"sentTimestamp", message.SentTimestamp},
				{"contextItems", message.ContextItems},
				{"timeToReadSeconds", (int)CalculatedTimeToRead(message).TotalSeconds}
			};

			return notification;
		}
Exemplo n.º 8
0
        internal ClientNotification GetClientNotifications(string clientId)
        {
            ClientNotification result = null;
            SqlDataReader      reader = null;
            SqlConnection      conn   = null;

            try
            {
                conn = Connect();
                SqlCommand cmd = new SqlCommand("knsp_clientNotification_get", conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                cmd.Parameters.Add("@clientId", System.Data.SqlDbType.VarChar, 64);
                cmd.Parameters["@clientId"].Value = clientId;

                reader = cmd.ExecuteReader();

                if (reader.HasRows)
                {
                    result          = new ClientNotification();
                    result.ClientId = clientId;

                    while (reader.Read())
                    {
                        result.Enabled      = reader.GetInt16(reader.GetOrdinal("enabled")) != 0;
                        result.CertPath     = reader.GetString(reader.GetOrdinal("certPath"));
                        result.CertPassword = reader.GetString(reader.GetOrdinal("certPassword"));
                        result.Sandbox      = reader.GetInt16(reader.GetOrdinal("sandbox")) != 0;
                        result.APIKey       = reader.GetString(reader.GetOrdinal("apiKey"));
                        result.ProjectId    = reader.GetString(reader.GetOrdinal("projectId"));
                        result.PackageName  = reader.GetString(reader.GetOrdinal("packageName"));
                    }
                }
            }
            catch (Exception ex)
            {
                //Logger.Instance.Error(this, "GetClientNotifications", ex);
            }
            finally
            {
                CloseReader(reader);
                Disconnect(conn);
            }
            return(result);
        }
Exemplo n.º 9
0
        public void PostNotification(ClientNotification notification, bool executeContentProviders)
        {
            string userId = Context.User.GetUserId();

            ChatUser user = _repository.GetUserById(userId);
            ChatRoom room = _repository.VerifyUserRoom(_cache, user, notification.Room);

            // User must be an owner
            if (room == null ||
                !room.Owners.Contains(user) ||
                (room.Private && !user.AllowedRooms.Contains(room)))
            {
                throw new InvalidOperationException("You're not allowed to post a notification");
            }

            var chatMessage = new ChatMessage
            {
                Id          = Guid.NewGuid().ToString("d"),
                Content     = notification.Content,
                User        = user,
                Room        = room,
                HtmlEncoded = false,
                ImageUrl    = notification.ImageUrl,
                Source      = notification.Source,
                When        = DateTimeOffset.UtcNow,
                MessageType = (int)MessageType.Notification
            };

            _repository.Add(chatMessage);
            _repository.CommitChanges();

            Clients.Group(room.Name).addMessage(new MessageViewModel(chatMessage), room.Name);

            if (executeContentProviders)
            {
                var urls = UrlExtractor.ExtractUrls(chatMessage.Content);
                if (urls.Count > 0)
                {
                    _resourceProcessor.ProcessUrls(urls, Clients, room.Name, chatMessage.Id);
                }
            }
        }
Exemplo n.º 10
0
        private void PopulateClientNotifications(string clientId)
        {
            if (clientNotificationrDict == null)
            {
                //Logger.Instance.Error(this, string.Format("PopulateClientNotifications application state error: clientNotificationrDict is null. clientid:{0}", clientId));
                return;
            }

            ClientNotification notification = null;;

            if (clientNotificationrDict.ContainsKey(clientId))
            {
                clientNotificationrDict.TryGetValue(clientId, out notification);
            }

            if (notification == null)
            {
                notification = DGSClients.Instance.GetClientNotifications(clientId);
                if (!clientNotificationrDict.ContainsKey(clientId))
                {
                    clientNotificationrDict.Add(clientId, notification);
                }
            }
        }
Exemplo n.º 11
0
 public void Publish(ClientNotification clientNotification)
 {
     _bus.Publish(clientNotification);
 }
Exemplo n.º 12
0
 public Task PostNotification(ClientNotification notification)
 {
     return(_chat.Invoke("PostNotification", notification));
 }
Exemplo n.º 13
0
 void OnDestroy()
 {
     s_Sigleton = null;
 }
Exemplo n.º 14
0
 public void NotifyCharacters(PyList <PyInteger> characterIDs, ClientNotification notification)
 {
     this.SendNotification(notification.NotificationName, NOTIFICATION_TYPE_CHARACTER, characterIDs, notification.GetElements());
 }
Exemplo n.º 15
0
 public void NotifyCorporation(int corporationID, ClientNotification notification)
 {
     this.SendNotification(notification.NotificationName, NOTIFICATION_TYPE_CORPORATON, corporationID, notification.GetElements());
 }
Exemplo n.º 16
0
        public string JsonDtoCompose(NotificationTypeDictionary notificationType, Dictionary<string, string> data)
        {
            var createdTasksTypes = new[]
                                        {
                                                NotificationTypeDictionary.TaskCreated,
                                                NotificationTypeDictionary.TaskCreateDocCreated,
                                                NotificationTypeDictionary.TaskVisaCreated,
                                                NotificationTypeDictionary.TaskManualExecute
                                        };

            if (createdTasksTypes.Contains(notificationType))
            {

                var newTaskNotification = new NewItemsNotification
                {
                    Ids = new[] { data["TaskId"] },
                    Type = NewItemsNotificationType.Task
                };

                var serializer = new JavaScriptSerializer();
                serializer.MaxJsonLength = int.MaxValue;
                string message = serializer.Serialize(newTaskNotification);
                var notificationData = new ClientNotification { Message = message, NotificationType = ClientNotificationType.NewItems };
                return serializer.Serialize(notificationData);
            }

            return string.Empty;
        }
Exemplo n.º 17
0
        internal void Render(WebGridHtmlWriter mywriter)
        {
            // MasterWebGrid is using SlaveGridMenu.
            if (((m_Grid.SystemMessage.CriticalCount == 0 && m_Grid.MasterGrid != null && m_Grid.MasterWebGrid != null &&
                  m_Grid.m_IsGridInsideGrid == false &&
                  m_Grid.MasterWebGrid.DisplaySlaveGridMenu &&
                  (m_Grid.MasterWebGrid.ActiveMenuSlaveGrid == null ||
                   m_Grid.MasterWebGrid.ActiveMenuSlaveGrid.ClientID != m_Grid.ClientID))
                 ) ||
                (m_Grid.m_IsGridInsideGrid && m_Grid.MasterWebGrid != null &&
                 m_Grid.MasterWebGrid.m_HasRendered == false))
            {
                return;
            }
            if (m_Grid.HideIfEmptyGrid && m_Grid.MasterTable.Rows.Count == 0 && m_Grid.SystemMessage.CriticalCount == 0 &&
                !m_Grid.m_ActiveColumnFilter)
            {
                if (m_Grid.EmptyDataTemplate != null)
                {
                    mywriter.Write(m_Grid.EmptyDataTemplate);
                }
                return;
            }

            m_Grid.m_HasRendered = true;

            if (m_Grid.Tag["wgcsslink"] != null)
            {
                mywriter.Write(m_Grid.Tag.Get("wgcsslink"));
            }
            if (m_Grid.Tag["wgscriptstyles"] != null)
            {
                mywriter.Write(m_Grid.Tag.Get("wgscriptstyles"));
            }
            if (m_Grid.PreGridTemplate != null)
            {
                mywriter.Write(m_Grid.PreGridTemplate);
            }

            string width = string.Empty;

            if (m_Grid.Width.IsEmpty == false)
            {
                width = string.Format(" width=\"{0}\"", m_Grid.Width);
            }

            StringBuilder sb = new StringBuilder();
            StringWriter  sw = new StringWriter(sb);

            System.Web.UI.HtmlTextWriter renderBeginTag = new System.Web.UI.HtmlTextWriter(sw);

            m_Grid.RenderBeginTag(renderBeginTag);

            string webAttributes = sb.ToString();

            // Remove first tag which is always 'id='
            webAttributes = webAttributes.Remove(0, webAttributes.IndexOf("id="));
            // Clean up..
            webAttributes = webAttributes.Remove(0, webAttributes.IndexOf(" "));

            webAttributes = string.Format("<table{0}", webAttributes.Remove(webAttributes.Length - 1));

            #region slavegrid menu

            bool systemMessagetriggered = false;
            if (m_Grid.DisplayView == DisplayView.Detail && m_Grid.DisplaySlaveGridMenu && m_Grid.SlaveGrid.Count > 0 &&
                m_Grid.InternalId != null)
            {
                mywriter.Write("<!--WebGrid menu starts rendering -->\n");
                mywriter.Write("{0} class=\"wgmenu\" {1}  cellpadding=\"0\" cellspacing=\"0\" id=\"wgMenu_{2}\"><tr><td>",
                               webAttributes,
                               width, m_Grid.ClientID);
                if (m_Grid.SystemMessage.Count > 0)
                {
                    mywriter.Write(m_Grid.SystemMessage.RenderSystemMessage);
                    if (m_Grid.Scripts == null || !m_Grid.Scripts.DisableBookmark)
                    {
                        Grid.AddClientScript(mywriter, string.Format("bookmarkscroll.init();bookmarkscroll.scrollTo('wgSystemMessage_{0}')", m_Grid.ID));
                    }
                    mywriter.Write("</td></tr><tr><td>");
                    systemMessagetriggered = true;
                }

                /* cellpadding and cellspacing are fixed because CSS does not support similar behavior*/
                mywriter.Write("<table class=\"wgmenunavigation\" cellpadding=\"0\" cellspacing=\"0\"><tr align=\"left\">");
                bool createmenuspace = false;

                foreach (Grid slavegrid in m_Grid.SlaveGrid)
                {
                    if (createmenuspace)
                    {
                        mywriter.Write("<td class=\"wgmenuspacing\"></td>");
                    }
                    else
                    {
                        createmenuspace = true;
                    }

                    if (m_Grid.ActiveMenuSlaveGrid != slavegrid)
                    {
                        string colorstyle = null;
                        if (Grid.MenuInactiveColor != Color.Empty)
                        {
                            colorstyle = string.Format("style=\"background-color:{0}\"",
                                                       Grid.ColorToHtml(Grid.MenuInactiveColor));
                        }

                        if (m_Grid.IsUsingJQueryUICSSFramework)
                        {
                            mywriter.Write(
                                "<td id=\"wgmenu_{0}_{1}\">{2}</td>",
                                m_Grid.ClientID, slavegrid.ClientID, m_Grid.SlaveGrid.GetSlaveGridAnchor(slavegrid));
                        }
                        else
                        {
                            mywriter.Write(
                                "<td id=\"wgmenu_{0}_{1}\"><div class=\"wglefttab_off\"></div><div {2} class=\"wginactivemenu wgrighttab_off\">{3}</div></td>",
                                m_Grid.ClientID, slavegrid.ClientID, colorstyle,
                                m_Grid.SlaveGrid.GetSlaveGridAnchor(slavegrid));
                        }
                    }
                    else
                    {
                        string colorstyle = null;
                        if (Grid.MenuActiveColor != Color.Empty)
                        {
                            colorstyle =
                                string.Format("style=\"background-color:{0}\"", Grid.ColorToHtml(Grid.MenuActiveColor));
                        }

                        if (m_Grid.IsUsingJQueryUICSSFramework)
                        {
                            mywriter.Write(
                                "<td id=\"wgmenu_{0}_{1}\">{2}</td>",
                                m_Grid.ClientID, slavegrid.ClientID, m_Grid.SlaveGrid.GetSlaveGridAnchor(slavegrid));
                        }
                        else
                        {
                            mywriter.Write(
                                "<td id=\"wgmenu_{0}_{1}\"><div class=\"wglefttab_on\"></div><div {2} class=\"wgactivemenu wgrighttab_on\">{3}</div></td>",
                                m_Grid.ClientID, slavegrid.ClientID, colorstyle,
                                m_Grid.SlaveGrid.GetSlaveGridAnchor(slavegrid));
                        }
                    }
                }
                mywriter.Write("</tr></table></td></tr></table><br/>");
                mywriter.Write("<!--WebGrid menu finished rendering -->\n");
            }

            #endregion

            if (m_Grid.SystemMessage.Count > 0 && systemMessagetriggered == false)
            {
                mywriter.Write(m_Grid.SystemMessage.RenderSystemMessage);
                if (m_Grid.Scripts == null || !m_Grid.Scripts.DisableBookmark)
                {
                    Grid.AddClientScript(mywriter,
                                         string.Format("bookmarkscroll.init();bookmarkscroll.scrollTo('wgSystemMessage_{0}')",
                                                       m_Grid.ID));
                }
            }
            mywriter.Write("<!--WebGrid grid starts rendering -->\n");
            mywriter.Write("{0} {1} cellpadding=\"0\" class=\"wgmaingrid\" cellspacing=\"0\" id=\"wgContent_{2}\"><tr><td>",
                           webAttributes, width, m_Grid.ID);
            ApplyAjaxLoader(mywriter);
            if (m_Grid.SystemMessage.CriticalCount == 0)
            {
                switch (m_Grid.DisplayView)
                {
                case DisplayView.Grid:
                    if (m_Grid.AllowEditInGrid && m_Grid.PageIndex == 0 && m_Grid.Page != null)
                    {
                        if (m_Grid.EnableCallBack)
                        {
                            mywriter.Write(
                                "<input type=\"hidden\" id=\"{0}_where\" name=\"{0}_where\" value=\"{1}\" />",
                                m_Grid.ClientID, HttpUtility.UrlEncode(m_Grid.FilterExpression, Encoding.Default));
                        }
                        else
                        {
                            m_Grid.Page.ClientScript.RegisterHiddenField(
                                string.Format("{0}_where", m_Grid.ClientID),
                                HttpUtility.UrlEncode(m_Grid.FilterExpression, Encoding.Default));
                        }
                    }
                    RenderGrid(ref m_Grid, ref mywriter);
                    break;

                case DisplayView.Detail:

                    RenderDetail(ref m_Grid, ref mywriter);
                    break;
                }
            }

            mywriter.Write("</td></tr></table>");
            mywriter.Write("<!--WebGrid grid finished rendering -->\n");

            if (m_Grid.Page != null && (m_Grid.Scripts == null || !m_Grid.Scripts.DisableWebGridClientObject))
            {
                m_Grid.JsOnData.AppendLine();
                m_Grid.JsOnData.Append(WebGridClientObject.GetGridObject(m_Grid));
            }

            if (m_Grid.Scripts == null || !m_Grid.Scripts.DisableContextMenu)
            {
                m_Grid.GetContextMenuHtml(mywriter);
                Grid.AddClientScript(mywriter, string.Format(contextscript, m_Grid.ID));
            }
            if (m_Grid.ClientNotifications != null && m_Grid.ClientNotifications.Count > 0 && (m_Grid.Scripts == null || !m_Grid.Scripts.DisableClientNotification))
            {
                ClientNotification clientSettings = m_Grid.ClientNotification ?? Grid.DefaultClientNotification;

                if (clientSettings.HeaderText == null)
                {
                    clientSettings.HeaderText = m_Grid.Title;
                }
                if (clientSettings.HeaderText == null)
                {
                    clientSettings.HeaderText = string.Empty;
                }

                StringBuilder template = string.IsNullOrEmpty(clientSettings.Container)
                                             ?
                                         new StringBuilder(
                    "$(document).ready( function() {{ $.jGrowl(\"{0}\", {{ header: '")
                                             :
                                         new StringBuilder(
                    string.Format(
                        "$(document).ready( function() {{ $('#{0}').jGrowl(\"{0}\", {{ header: '",
                        clientSettings.Container));

                template.Append(clientSettings.HeaderText.Replace("\"", "\\"));
                template.AppendFormat("', sticky: {0}", clientSettings.Sticky.ToString().ToLower());
                template.AppendFormat(", life: {0}", clientSettings.LifeSpan);
                if (clientSettings.CloserTemplate != null)
                {
                    template.AppendFormat(", closerTemplate: '{0}'",
                                          clientSettings.CloserTemplate.Replace("\"", "\\"));
                }
                template.Append(", closer: " + clientSettings.Closer.ToString().ToLower());
                if (!string.IsNullOrEmpty(clientSettings.CssClass))
                {
                    template.AppendFormat(", theme: '{0}'", clientSettings.CssClass);
                }
                template.Append("}}); }});");

                if (m_Grid.ClientNotifications.Count > 0)
                {
                    foreach (string arg in m_Grid.ClientNotifications)
                    {
                        Grid.AddClientScript(mywriter,
                                             string.Format(template.ToString(), arg.Replace("\"", "\\")));
                    }
                }
            }

            if ((m_Grid.Scripts == null || !m_Grid.Scripts.DisableInputMask) && m_Grid.MaskedColumns.Count > 0)
            {
                StringBuilder masks = new StringBuilder();

                foreach (KeyValuePair <string, string> dictionary in m_Grid.MaskedColumns)
                {
                    if (masks.Length > 3)
                    {
                        masks.Append(", ");
                    }
                    masks.AppendFormat("{0}:{{ mask: {1} }}", dictionary.Key, dictionary.Value);
                }
                string options;
                if (m_Grid.MaskedInput != null)
                {
                    options = string.Format("{{selectCharsOnFocus: {0},textAlign: {1},autoTab:{2}, attr: '{3}'}}",
                                            MaskedInput.GetStringValue(m_Grid.MaskedInput.EnableSelectCharsOnFocus),
                                            MaskedInput.GetStringValue(m_Grid.MaskedInput.EnableTextAlign),
                                            MaskedInput.GetStringValue(m_Grid.MaskedInput.EnableAutoTab),
                                            m_Grid.MaskedInput.Attribute);
                }
                else
                {
                    options = "{selectCharsOnFocus: true,textAlign: false,autoTab:false, attr: 'alt'}";
                }

                Grid.AddClientScript(mywriter, string.Format(meiomask, m_Grid.ID, masks, options));
            }
            if (Anthem.Manager.IsCallBack && (m_Grid.Scripts == null || !m_Grid.Scripts.DisableHoverButtons))
            {
                Grid.AddClientScript(mywriter, Grid.HoverButtonScript);
            }
            if (m_Grid.JsOnData.Length > 2)
            {
                mywriter.Write(@"<script type=""text/javascript"">{0}</script>", m_Grid.JsOnData.ToString());
            }

            mywriter.Close();
            if (m_Grid.Trace.IsTracing)
            {
                m_Grid.Trace.Trace("Finish Render();");
            }
        }
Exemplo n.º 18
0
 public void PostNotification(ClientNotification notification)
 {
 }
Exemplo n.º 19
0
 public void PostNotification(ClientNotification notification, bool executeContentProviders)
 {
 }
Exemplo n.º 20
0
 public void PostNotification(ClientNotification notification)
 {
 }
Exemplo n.º 21
0
 public void NotifyStation(int stationID, ClientNotification notification)
 {
     this.SendNotification(notification.NotificationName, NOTIFICATION_TYPE_STATION, stationID, notification.GetElements());
 }
Exemplo n.º 22
0
 public void PostNotification(ClientNotification notification, bool executeContentProviders)
 {
 }
Exemplo n.º 23
0
 public void SendNotification(string idType, PyList idsOfInterest, ClientNotification data)
 {
     this.SendNotification(data.NotificationName, idType, idsOfInterest, data.GetElements());
 }
		public async Task<ApiResult> SynchroniseAsync()
		{
			return await ApiResult.ForOperationAsync(async () =>
			{
				// We only want to allow one sync operation at a time.
				await _synchroniseLock.WaitAsync();

                _logger.LogDebug("Starting Notification Synchronise");

				var syncNeeded = true;
				while (syncNeeded)
				{
					// Get client notifications that are pending transmission

                    var notifications = await _dataContext.ClientNotifications.GetAllAsync();
                    var clientNotifications = notifications.Select(c => c.Notification).ToList();

					await ProcessOutboundSubscriptionsAsync(clientNotifications);

					var result = await _notificationService.SynchroniseAsync(new SynchroniseRequest
					{
						ClientNotifications = clientNotifications
							.Cast<Dictionary<string, object>>().ToList(),
						IsBackground = !_appState.IsOpen
					});

					var notificationsToRetry = new List<ClientNotification>();
					foreach (var failedNotification in result.FailedClientNotifications)
					{
						var notification = new ClientNotification(failedNotification.Notification);

						switch (failedNotification.FailureReason)
						{
							case ClientNotificationFailureReason.ValidationFailure:
                                _logger.LogValidationWarning(failedNotification.ValidationFailures,
                                    "Client notification of type {0} failed validation and will not be retried.",
                                    notification.Type);
								break;

							case ClientNotificationFailureReason.Other:
								// Retry
                                _logger.LogInformation("Server reported other failure for notification of type {0}, requeuing",
                                        notification.Type);
								notificationsToRetry.Add(notification);
								break;
						}
					}
                    var temp = _dataContext.ClientNotifications;
                    var temp4 = _dataContext.ClientNotifications.CountAsync();
					// Delete processed notifications
					foreach (var toDelete in notifications)
					{
						await _dataContext.ClientNotifications.DeleteAsync(toDelete.Id);
					}
					await _dataContext.SaveChangesAsync();

				    var temp1 = _dataContext.ClientNotifications;
                    var temp3 = await _dataContext.ClientNotifications.CountAsync();

					// Handle server notifications
					foreach (var notification in result.ServerNotifications)
					{
						var serverNotification = CreateInternalServerNotification(notification);
						await HandleServerNotificationAsync(serverNotification);
					}

					// Requeue notifications that we need to retry
					await QueueClientNotificationAsync(notificationsToRetry.ToArray());

				    var temp2 = await _dataContext.ClientNotifications.CountAsync();
					// Test to see if we need to perform another sync
					syncNeeded = result.MoreNotificationsAvailable || (await _dataContext.ClientNotifications.CountAsync()) > 0;

                    _logger.LogDebug("syncNeeded: {0}", syncNeeded);
				}

                _logger.LogDebug("Exiting Notification Synchronise");

				_synchroniseLock.Release();

                }, "SynchroniseAsync");

		}
Exemplo n.º 25
0
 public async Task Send(string userId, ClientNotification clientNotification)
 {
     Thread.Sleep(TimeSpan.FromSeconds(5));
     await Send(userId, new PushMessage(JsonConvert.SerializeObject(clientNotification)));
 }
Exemplo n.º 26
0
 public void Handle(ClientNotification notification)
 {
     //hub.Clients.All.messageRecieved(notification);
     hub.Clients.Client(notification.ClientId.ToString()).messageRecieved(notification);
 }
Exemplo n.º 27
0
 public void PostNotification(ClientNotification notification)
 {
     PostNotification(notification, executeContentProviders: true);
 }
Exemplo n.º 28
0
 public Task PostNotification(ClientNotification notification, bool executeContentProviders)
 {
     return(_chat.Invoke("PostNotification", notification, executeContentProviders));
 }
		private ClientNotification CreateInteractionResultNotification(Message message, string interactionType, string buttonDescription, string userAction, DateTime interactionTime)
		{
			var notification = new ClientNotification
			{
				{"type", "InteractionResult"},
				{"senderInternalUserId", message.SenderInternalUserId},
				{"messageId", message.MessageId},
				{"senderMessageId", message.SenderMessageId},
				{"timeToInteractionSeconds", (int)(interactionTime - message.SentTimestamp).TotalSeconds},
				{"interactionTimeStamp", interactionTime},
				{"interactionType", interactionType},
				{"buttonDescription", buttonDescription},
				{"userAction", userAction},
				{"operatingSystem", _environmentInformation.OperatingSystem},
				{"messageSentTimestamp", message.SentTimestamp},
				{"contextItems", message.ContextItems},
			};

			return notification;
		}
Exemplo n.º 30
0
 void Awake()
 {
     s_Sigleton = this;
     this.DontDestroyOnLoad(this.gameObject);
 }