I am developing a mobile application using firebase and android studio. In that I like to have a Whatsapp sort of functionality to have an interconnection between group chat and private chat . In whatsapp group messages if we click the name of the messenger (please note that in the name , not on the message, see the attached picture), a popup opens and there will an option to do private message to that particular person. In a similar way I like to do private message from group chat in my app. I think they had used 'onClickListenerRecyclerAdapter' for displaying the group messages, but I am not having an idea how they have done only for the name. If some one know how to connect group chat to private chat please help .
In your screenshot, the message from Veena is displaying:
Veena's name.
The message timestamp.
The message content, 'Hi'.
But there are plenty of other properties, as you know of course, being stored in this message object, one of them is Veena's ID.
The popup menu, will be an extension to the message object, which inherits the properties of the message for the callback after pressing the message itself. It'll also show Veena's name, but selecting it, will/should take you to the chat which corresponds to Veena's ID.
Related
Is it possible to prevent my bot from being invited into groups and for it to only be available for private chat? I intend to create a bot that will give user-specific information and this would be confusing within a group.
Sure, you can use /setjoingroups command in #BotFather.
BTW, there has leaveChat, you can leave yourself if your bot joined group before set this.
When receiving a message, check if the chatid and userid is the same, if so, ignore.
During a conversation sequence, when an user provides an input for a response coming from the conversation service based on his/her previous question, I am building a new request to the conversation service by passing the previous question as input text and the previous context.
The previous context is to let the Conversation service know the conversation id. The previous input text (question) is to let the Conversation service identify and resume from where it was left (the right dialog node).
My application uses the user input for validation and updating the context. For instance, setting the context as user "verified" etc.
My application gets the previous input text from the context object of conversation service.
Could you please let me know if i am doing right?
I'm developing some messenger with JavaFX just to get more familiar with this technology.
Contact has two main properties: User and last Message.
I need to show
list of contacts with most recent messages
list of contacts sorted by name
I came to two solutions so far
First solution is to make Contact immutable. So it is required to replace contact every time a new message arrives or user's information changes. It works, but Contact blinks in ListView on update.
Second solution is to use ObjectProperty:
public class Contact {
private final ObjectProperty<User> user = ...;
private final ObjectProperty<Message> lastMessage = ...;
}
In that case I have to create custom ObservableList to add/remove listeners to Contact's properties when Contact is added/removed to/from list. It's required because both lists should be automatically sorted.
So both solutions have drawbacks.
Please, give your recommendations on how to achieve my goal.
In the FXCollections class, there is one method that uses an "extractor" function to tell the list which properties from the list items should fire list change events:
https://docs.oracle.com/javase/8/javafx/api/javafx/collections/FXCollections.html#observableArrayList-javafx.util.Callback-
This will give you the same approach as your second solution, but without you having to write the code to manage the listeners yourself.
I need to be able to have a chat where inside a group, there will be two members, and one will be able to send a message to the other, in one direction only.
I'm trying
Clients.Group(group).User(user)
But Group does not have a User method
It helps to browse through class members...
Clients.OthersInGroup(group)
I'm using Flags, Commons follow, Message and Rules modules to create the ability for users to follow each other.
I use commons auto generated commons_follow_user flag to create a follow button. I generate that button through views on each node. If user A presses the button on the node submitted by user B, user A starts following user B. By default commons follow user module shows user B name on user A account page. What I also need is for user A to see activity stream of the user B, more specifically to see when user B adds new node. I understand that I have to use rules and messages modules. I have created a rule that triggers Message entity creation on new node creation but how do I make this stream only visible to users following the user that creates those nodes? Is there a way with rule conditions? Or should I look in the other direction to achieve this?
It looks like you're trying to create some sort of social network.
A module I'm pretty fond of us the Statuses module
If you're just looking for something that will post activity, there's also the heartbeat module
I hope that helps.