Falcon Space. Working with chat

Chat settings

Chat allows you to organize instant messaging between site users. A chat can be attached to certain entities, such as an order. 

Default implementation -/messages (correspondence with other system users).
There are rooms where users communicate. 
To display the list of rooms (chats), insert this markup: 
<div class="as-messages" data-code="userchat"></div>

If the data-roomID or data-itemID parameter is not passed, a list of all available userchat rooms for this user is output.
If we want to display a specific room correspondence, t o specify:
<div class= "as-messages" data-code= "userchat" data-roomid= " {roomID}" > </div >
<div class="as-messages" data-code="userchat" data-itemid= " {itemID}" ></div >,
where roomID is the room ID (only for existing rooms). itemID-ID of an entity (for example, an order). 

Create new stored procedures for the new type:

  • msg_{typeCode}_getAvailableUsersForRoom - defines the list of users in the group.
  • msg_{typeCode}_getRoom - get a room
  • msg_{typeCode}_getRooms - get a list of rooms
  • msg_{typeCode}_afterSendMessage-sets push notification settings and allows performing external actions. 

They must be done in strict analogy with the procedures for the code userchat

Description of the SQL callback AfterSendMessage

The procedure sets the push notification settings for this message (PWA and Push must be enabled in GetLayout). 
The procedure also allows you to callan external action .

create procedure [dbo].[msg_example_afterSendMessage]

@messageID int,
@username nvarchar(128)
-- SELECT 1 - Settings for push notifications
select 'https://google.com' linkUrl,  'SHOW Message' linkTitle, 0 DisablePush
-- SELECT 2 A call to an external action
-- ... email, notifiocation, sms, clearcache,

SELECT 1 returns push settings. In this case, you can use messageID to determine whether or not to send a push. 
Also here you specify a specific link that the user can go to when clicking on the push notification. 

sets a set of external actions that can be performed after adding a message. 

Falcon Space is a functional web development platform on a narrow stack MS SQL/Bootstrap. Falcon Space Gettting started

Falcon Space Platform

This is a reduction in the cost of ownership

at the expense of fewer people to support

This is a quick change

while using the program

This is a modern interface

full adaptation for mobile devices