mirror of
https://github.com/ChronosX88/Influence-P2P.git
synced 2024-11-22 15:22:18 +00:00
Changed setting chat name in CREATE_CHAT message
This commit is contained in:
parent
8e701da329
commit
6ee7223fcd
@ -34,8 +34,8 @@ public class NetworkHandler implements NetworkObserver {
|
|||||||
switch (getMessageAction((String) object)) {
|
switch (getMessageAction((String) object)) {
|
||||||
case NetworkActions.CREATE_CHAT: {
|
case NetworkActions.CREATE_CHAT: {
|
||||||
NewChatRequestMessage newChatRequestMessage = gson.fromJson((String) object, NewChatRequestMessage.class);
|
NewChatRequestMessage newChatRequestMessage = gson.fromJson((String) object, NewChatRequestMessage.class);
|
||||||
createChatEntry(newChatRequestMessage.getChatID(), newChatRequestMessage.getChatID(), newChatRequestMessage.getSenderPeerAddress());
|
createChatEntry(newChatRequestMessage.getChatID(), newChatRequestMessage.getSenderID(), newChatRequestMessage.getSenderPeerAddress());
|
||||||
handleIncomingChat(newChatRequestMessage.getChatID(), newChatRequestMessage.getSenderPeerAddress());
|
handleIncomingChatRequest(newChatRequestMessage.getChatID(), newChatRequestMessage.getSenderPeerAddress());
|
||||||
JsonObject jsonObject = new JsonObject();
|
JsonObject jsonObject = new JsonObject();
|
||||||
jsonObject.addProperty("action", UIActions.NEW_CHAT);
|
jsonObject.addProperty("action", UIActions.NEW_CHAT);
|
||||||
AppHelper.getObservable().notifyUIObservers(jsonObject);
|
AppHelper.getObservable().notifyUIObservers(jsonObject);
|
||||||
@ -68,7 +68,7 @@ public class NetworkHandler implements NetworkObserver {
|
|||||||
AppHelper.getChatDB().chatDao().addChat(new ChatEntity(chatID, name, "", Serializer.serialize(peerAddress)));
|
AppHelper.getChatDB().chatDao().addChat(new ChatEntity(chatID, name, "", Serializer.serialize(peerAddress)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleIncomingChat(String chatID, PeerAddress chatStarterAddress) {
|
private void handleIncomingChatRequest(String chatID, PeerAddress chatStarterAddress) {
|
||||||
NewChatRequestMessage newChatRequestMessage = new NewChatRequestMessage(AppHelper.getPeerID(), peerDHT.peerAddress());
|
NewChatRequestMessage newChatRequestMessage = new NewChatRequestMessage(AppHelper.getPeerID(), peerDHT.peerAddress());
|
||||||
newChatRequestMessage.setChatID(chatID);
|
newChatRequestMessage.setChatID(chatID);
|
||||||
newChatRequestMessage.setAction(NetworkActions.SUCCESSFULL_CREATE_CHAT);
|
newChatRequestMessage.setAction(NetworkActions.SUCCESSFULL_CREATE_CHAT);
|
||||||
|
Loading…
Reference in New Issue
Block a user