This is a migrated thread and some comments may be shown as answers.

chat datasource?

5 Answers 545 Views
Chat
This is a migrated thread and some comments may be shown as answers.
binary
Top achievements
Rank 1
binary asked on 03 Dec 2019, 09:38 AM

Hello

Is there any way to keeping all the messages in chat ui, is there a workaround so that I store the historical messages on  user return then show the historical messages?

 

Thank you

5 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 05 Dec 2019, 06:53 AM

Hello,

he Chat widget itself does not support DataSource binding. Nevertheless, you could store each message from the chant in your own custom source. Upon loading the Chat, you could render all the stored messages. To save those messages you could handle the sendMessage event of the Chat. To display them, you should use the renderMessage() method of the widget.

Here you could find a small Dojo sample demonstrating such an approach: https://dojo.telerik.com/EFuMefIn/3

Regards,
Veselin Tsvetanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Daniel Blendea
Top achievements
Rank 1
answered on 16 Feb 2020, 08:04 PM

Hello,

In case the messages are "sent" by multiple users - such as when the chat is integrated with SignalR - and the user name and user identifier are stored in the message, how does the chat know to render the messages per different user?

0
Veselin Tsvetanov
Telerik team
answered on 18 Feb 2020, 12:46 PM

Hi Daniel,

For such a scenario I would recommend you to carefully examine the Pear-to-pear integration article from our documentation:

https://docs.telerik.com/kendo-ui/controls/conversational-ui/chat/integrations/signalr-p-to-p

Notice the implementation of the ChatHub class in SignalR:

public class ChatHub : Hub
{
	public async Task Send(object sender, string message)
	{
		// Broadcast the message to all clients except the sender.
		await Clients.Others.SendAsync("broadcastMessage", sender, message);
	}

	public async Task SendTyping(object sender)
	{
		// Broadcast the typing notification to all clients except the sender.
		await Clients.Others.SendAsync("typing", sender);
	}
}

It should be implemented to broadcast messages and typings only to the Others clients in the SignalR hub. That logic should be handled bu the hub and not by the Chat itself.

As a side note, in case you have any other questions which are not directly related to the original topic of the current thread ("chat datasource?"), please open a separate ticket for each of them. This way we will be able to keep each thread focused and to provide you with the most appropriate assistance on each case.

Regards,
Veselin Tsvetanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dale
Top achievements
Rank 1
answered on 25 Mar 2021, 08:30 AM
That's a very good idea to keep all chat in one place. Is this really possible?
0
Veselin Tsvetanov
Telerik team
answered on 26 Mar 2021, 02:25 PM

Hi Dale,

I am not quite sure I understand correctly your question. What do you mean by "keep all chat in one place"? May I ask you to elaborate a bit on that?

Regards,
Veselin Tsvetanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Chat
Asked by
binary
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Daniel Blendea
Top achievements
Rank 1
Dale
Top achievements
Rank 1
Share this question
or