use of org.olat.instantMessaging.InstantMessagingEvent in project openolat by klemens.
the class InstantMessagingServiceImpl method sendMessage.
@Override
public InstantMessage sendMessage(Identity from, String fromNickName, boolean anonym, String body, OLATResourceable chatResource) {
InstantMessage message = imDao.createMessage(from, fromNickName, anonym, body, chatResource);
// commit before sending event
dbInstance.commit();
InstantMessagingEvent event = new InstantMessagingEvent("message", chatResource);
event.setFromId(from.getKey());
event.setName(fromNickName);
event.setAnonym(anonym);
event.setMessageId(message.getKey());
coordinator.getCoordinator().getEventBus().fireEventToListenersOf(event, chatResource);
return message;
}
Aggregations