Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
AliVireTechnologies1 #1
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
Subject: How can we get the someone is typing a message.
I want in my chat screen that i could find that some one is typing .
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
see: http://www.ag-software.net/matrix-xmpp-sdk/matrix-develope…
Avatar
AliVireTechnologies1 #3
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
if it is in event click button then how it will work, how can i show image on receiving end.

 Utility.xmppClient.Send(new Matrix.Xmpp.Client.Message { To = PhoneNumber + "@" + Utility.Domain + "/Matrix-Windows-Phone", Type = Matrix.Xmpp.MessageType.chat, Body = TextInput.Text, Chatstate = Matrix.Xmpp.Chatstates.Chatstate.composing });
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you should not send the chat state with your message. You should send the chat state only as soon as the user starts typing.
Avatar
AliVireTechnologies1 #5
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
from what event i can send and find that, how can i send chat state as soon as user starts typing.
Avatar
Alex #6
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by AliVireTechnologies1 on 2013-07-01, 12:14:
from what event i can send and find that, how can i send chat state as soon as user starts typing.

this questions is not related to MatriX. This depends on the UI you are using. For a Textbox control you can eg. use the TextChange event. When the text changes then the user is typing.

Alex
Avatar
AliVireTechnologies1 #7
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
ok fine, I'm using these following lines in textchange event for sending the chat state someone is typing .

  1. var msg = new Message() {To = "user@server.com", Type = MessageType.chat};
  2. msg.Chatstate = Matrix.Xmpp.Chatstates.Chatstate.composing;

but question is how can i receive this on receiving end.
This post was edited on 2013-07-08, 13:44 by Alex.
Avatar
Alex #8
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
in the OnMessage event check for messages with empty body and then check if the chatstate is composing.

  1. if (e.Message.Body == null)
  2. {
  3.    if (msg.Chatstate == Matrix.Xmpp.Chatstates.Chatstate.composing)
  4.    {
  5.       // got a composing chat event.
  6.    }
  7. }

and don't send a composing message not on every textchange event. Send it only once when the user starts typing. For the next new message send it again.
Avatar
AliVireTechnologies1 #9
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #6
ok thanks done :)
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS