Skip to content

Commit

Permalink
igniterealtime#166: Refactor to conform to naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
guusdk committed Mar 15, 2023
1 parent ef6eaa0 commit aaa3769
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void interceptPacket(Packet packet, Session session, boolean incoming, bo
else if (conversationManager.isEmptyMessageArchivingEnabledFor(message))
{
eventsQueue.addChatEvent(conversationManager.getConversationKey(sender, receiver),
ConversationEvent.getEmptyMessageReceivedEvent(sender, receiver,
ConversationEvent.emptyMessageReceivedEvent(sender, receiver,
message.toXML(),
new Date()));
}
Expand Down
20 changes: 10 additions & 10 deletions src/java/org/jivesoftware/openfire/archive/ConversationEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ public static ConversationEvent roomMessageReceived(JID roomJID, JID user, JID r
return event;
}

public static ConversationEvent emptyMessageReceivedEvent(JID sender, JID receiver, String stanza, Date date) {
ConversationEvent event = new ConversationEvent();
event.type = Type.chatMessageReceived;
event.sender = sender;
event.receiver = receiver;
event.date = date;
event.stanza=stanza;
return event;
}

private enum Type {
/**
* Event triggered when a room was destroyed.
Expand Down Expand Up @@ -195,14 +205,4 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(type, date, body, stanza, sender, receiver, roomJID, user, nickname);
}

public static ConversationEvent getEmptyMessageReceivedEvent(JID sender, JID receiver, String stanza, Date date) {
ConversationEvent event = new ConversationEvent();
event.type = Type.chatMessageReceived;
event.sender = sender;
event.receiver = receiver;
event.date = date;
event.stanza=stanza;
return event;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ else if (conversationManager.isEmptyMessageArchivingEnabledFor(message))
ConversationEventsQueue eventsQueue = conversationManager.getConversationEventsQueue();

eventsQueue.addGroupChatEvent(conversationManager.getRoomConversationKey(roomJID),
ConversationEvent.getEmptyMessageReceivedEvent(roomJID, user, message.toXML(), new Date()));
ConversationEvent.emptyMessageReceivedEvent(roomJID, user, message.toXML(), new Date()));
}
}
}
Expand Down

0 comments on commit aaa3769

Please sign in to comment.