Closed prashantpimpale93 closed 5 years ago
Hi @prashantpimpale93
I am glad you enjoyed it so far. Group chat is not an available feature of this module, it would have to be implemented from scratch.
Could you list or describe a bit more in detail your requirements for Groups?
Cheers!
@rpaschoal
My requirement - Chat in One to many relationship for ex. User (Who is sender) who is sending message his/her message should be keep to right side other than this should be to right no matter who user is who is other end.
Description - User Id [143] who is sending message to every user so when I clicked on user (List of friends) I called my firebase query (We have design our firebase DB in such manner where node is stored in such format to get the data on basis of user. So just need to align message as per two category like own(float right) or other (float left).
Suggestion - You could provide one flag (for temporary purpose) and change in ts code with that flag if that flag is true then display window with message as per above description
@prashantpimpale93 Are you using a group as an user in your ng-chat implementation?
Groups is not a feature at the moment, it is a nice addition but would take a while to implement it. I am wondering if you could get around with your API returning groups as users.
@rpaschoal Take your own time. I also started working on this feature in forked repo (But it will take time) but if you can implement this feature on priority then this library will become power packed with all feature. I have searched on the internet but not a single library which I found like your's.
@rpaschoal One more thing that I would like to discuss:
For temporary purpose have used UI part of library (As group chat is on priority for my) In my component ts file have used list which is two day data binding but whenever I clicked on new user the new window gets created but the data or message list is synced with all open windows. For ex: If I clicked on user1 --> message list is loaded from firebase (message count is 10) If I clicked on user2 --> message list is loaded from firebase (message count is 65)
Result at the end -- > 65 message is synced among all the opened windows
Is there any solution or do I miss something?
HI All
I done the group chat. Chatadapter do follow the changes listFriends(): Observable<User[]> { return this.API.get("friends/me",{userId:this.userId},true) .map(res=>{
for(let e of res)
{
let userGet=this.setName(e.from_id,e.to_id);
e.id=userGet.id+"-"+e._id;
e.displayName=userGet.name+"["+e.customer.sub_property_type+"]";
e.avatar=e.image;
e.status=0;
e.user=userGet.id;
e.customer=e.customer._id
e.chat_id=e._id;
this.mockedUsers.push(e)
}
this.users=this.mockedUsers;
//this.socket.emit("sendFriends", this.mockedUsers);
this.socket.emit("newUser",this.userId)
return this.mockedUsers;
},error=>{
console.log(error.error);
});
} id=>connect with group id. e.id=userGet.id+"-"+e._id =>e._id is group window ID. sendMessage(message: Message): void { let msg={ msg:message.message, customer:message.customer, con_id:message.windowID, fromId:message.fromId, toId:message.toId, from_id:message.from_id, to_id:message.to_id, chat_user:message.chat_user, timestamp:Date.now() }
this.socket.emit("sendMessage", message);
this.API.post("/friends/newMsg",msg).subscribe(msg=>{
})
}
from_id:message.from_id => default from user id to_id:message.to_id =>to user id
Few More Modifications on the ng-chat.js this.adapter.getMessageHistory(userID) userID=>group id
sendMessage(window) { if (window.newMessage && window.newMessage.trim() != "") { var /* @type {?} / message = new Message(); let id=window.chattingTo.id.split("-"); message.fromId = this.userId+"-"+window.chattingTo.chat_id; message.toId = window.chattingTo.id; message.from_id=this.userId; message.to_id=id[0]; message.windowID=window.chattingTo.chat_id; message.customer=window.chattingTo.customer; message.message = window.newMessage; message.chat_user= message.fromId; window.messages.push(message); this.adapter.sendMessage(message); window.newMessage = ""; // Resets the new message input this.scrollChatWindowToBottom(window); } }
If you anyone want do Group chat contact me.
Hi @arulananth ,
Great news, would you be able to push a demo to this repository so other people can refer to it? I belive this will help a lot of people that want to use it for groups too.
There is a demo
folder with different adapter implementations, would be nice to have a group one there if possible.
Cheers!
@rpaschoal great project!
Any updates on the group feature?
Hi @BelvedereHenrique ,
It is not on my list of planned features for the next releases but if people keep voting for it I might reshuffle the priorities.
I am working on 1.3.0
at the moment and it will be shipping all the issues marked with the Upcoming Features
label here on the issues list. For the next release I was planning to implement a feature in which the chat window could be "maximized" and dragged around the viewport but this might take some time.
Could you elaborate a bit on your requirements for group chat and what you expect of it? Perhaps if it does not sound like a massive job I could implement that for 1.4.0
.
Cheers!
Thanks for the reply @rpaschoal
Well, for a group chat, I can only imagine these features for a basic release:
The ability to create a group of more than 2 users on the chat. The ability to give the group a name and rename it as well. Could be a global name and further evolve into customizable names per user. The ability to set up a thumbnail. The ability to send attachments to all users on the group.
My knowledge on Angular is not very exciting, so I don't really know how hard is to develop all those things, given the project structure etc., but let me know if there's anything I could help on that!
Hi @BelvedereHenrique ,
Thank you for your input. This feature request seems to be getting some traction so I've decided to implement it for the next release. I was working on 1.3.0
but it introduces breaking changes to the adapter so I will releasing that with 2.0.0
and group chat support.
It won't have all of the suggested features that you have proposed for now but we can later on iterate on that and add the support for it.
Will keep you all updated here once it is released... Trying to find some time to implement all of the requested features 😸
Cheers
Great!
Thank you.
Hi @BelvedereHenrique and @prashantpimpale93 ,
I've just published 2.0.0-rc.1
to NPM. There is now initial support for group chat there.
I haven't merged the changes on the master branch yet as this is an RC release so please refer to the README on this link for instructions on the new features: https://github.com/rpaschoal/ng-chat/tree/2.0.0-rc.1
I am planning on building a .net core application with a full demo of ng-chat and all its features, and only after that I'll be moving it to 2.0.0
as it will be a good opportunity for better testing and fine tuning of this release.
Cheers!
Great!
We've been working on group chat for a few days by now. We might be able to create a PR and maybe merge our work.
Hi @rpaschoal,
It was nice to use your library, which is the perfect fine for P2P chat but as came across Group chat this is not working or do I need to do some additional settings in Adapter.
Will love to listen from you!