Skip to content

Commit

Permalink
finished first shippable iteration of message center. close #2018
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Oct 10, 2023
1 parent 4c017a6 commit d1ea9d2
Show file tree
Hide file tree
Showing 18 changed files with 1,266 additions and 60 deletions.
2 changes: 1 addition & 1 deletion docker/getversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jlversion=`echo "$jlversion" | tr _ .`

# tadaaa!
# echo $jlversion
echo 2.5.0.1
echo 2.5.0.2

Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,11 @@

import com.jdimension.jlawyer.client.editors.EditorsRegistry;
import com.jdimension.jlawyer.client.events.EventBroker;
import com.jdimension.jlawyer.client.events.InstantMessageMentionChangedEvent;
import com.jdimension.jlawyer.client.events.NewInstantMessagesEvent;
import com.jdimension.jlawyer.client.settings.ClientSettings;
import com.jdimension.jlawyer.persistence.InstantMessage;
import com.jdimension.jlawyer.persistence.InstantMessageMention;
import com.jdimension.jlawyer.services.JLawyerServiceLocator;
import java.util.Date;
import java.util.List;
Expand All @@ -682,6 +684,7 @@ public class MessagePollingTimerTask extends java.util.TimerTask {
private static final Logger log = Logger.getLogger(MessagePollingTimerTask.class.getName());
private long lastPolled = -1;
private long lastMessageTimestamp=-1;
private long lastMentionStatusChangedTimestamp=-1;

protected static long unseenByUser=0;

Expand Down Expand Up @@ -713,6 +716,19 @@ public void run() {
EventBroker eb = EventBroker.getInstance();
eb.publishEvent(new NewInstantMessagesEvent(newMessages));
}

List<InstantMessageMention> updatedMentions=locator.lookupMessagingServiceRemote().getUpdatedMentionsSince(new Date(this.lastMentionStatusChangedTimestamp));
if(updatedMentions!=null) {
if(!updatedMentions.isEmpty()) {
this.lastMentionStatusChangedTimestamp=updatedMentions.get(updatedMentions.size()-1).getStatusChanged().getTime();
}
EventBroker eb = EventBroker.getInstance();
for(InstantMessageMention me: updatedMentions) {
InstantMessageMentionChangedEvent meevt=new InstantMessageMentionChangedEvent(me.getMessage().getId(), me.getId(), me.isDone());
eb.publishEvent(meevt);
}

}

} catch (Throwable ex) {
log.error("Error connecting to server", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="lblPanelTitle" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="cmbDownloadMails" min="-2" max="-2" attributes="0"/>
<Component id="lblPopoutMessenger" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cmbDownloadInstantMessages" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
Expand All @@ -35,7 +37,7 @@
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tabsPane" pref="858" max="32767" attributes="0"/>
<Component id="tabsPane" pref="875" max="32767" attributes="0"/>
<Component id="messageSendPanel1" max="32767" attributes="0"/>
</Group>
</Group>
Expand All @@ -49,24 +51,25 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jLabel18" alignment="1" pref="48" max="32767" attributes="0"/>
<Component id="lblPanelTitle" alignment="1" max="32767" attributes="0"/>
<Component id="cmbDownloadMails" alignment="0" min="-2" pref="46" max="-2" attributes="0"/>
<Component id="cmbDownloadInstantMessages" alignment="0" min="-2" pref="46" max="-2" attributes="0"/>
<Component id="cmdRefresh" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Component id="lblPopoutMessenger" alignment="0" max="32767" attributes="0"/>
<Component id="lblPanelTitle" alignment="0" max="32767" attributes="0"/>
<Component id="jLabel18" alignment="0" pref="42" max="32767" attributes="0"/>
</Group>
<Component id="cmdRefresh" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="tabsPane" pref="453" max="32767" attributes="0"/>
<Component id="lblClearHashtagSelection" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="messageSendPanel1" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="520" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="lblClearHashtagSelection" min="-2" max="-2" attributes="0"/>
<Component id="tabsPane" pref="0" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="495" max="32767" attributes="0"/>
<Component id="messageSendPanel1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
Expand Down Expand Up @@ -98,24 +101,26 @@
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="4"/>
</AuxValues>
</Component>
<Component class="javax.swing.JComboBox" name="cmbDownloadMails">
<Component class="javax.swing.JComboBox" name="cmbDownloadInstantMessages">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
<FontInfo relative="true">
<Font component="cmbDownloadMails" property="font" relativeSize="true" size="0"/>
<Font component="cmbDownloadInstantMessages" property="font" relativeSize="true" size="0"/>
</FontInfo>
</Property>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4">
<StringItem index="0" value="Item 1"/>
<StringItem index="1" value="Item 2"/>
<StringItem index="2" value="Item 3"/>
<StringItem index="3" value="Item 4"/>
<StringArray count="5">
<StringItem index="0" value="7"/>
<StringItem index="1" value="30"/>
<StringItem index="2" value="90"/>
<StringItem index="3" value="180"/>
<StringItem index="4" value="365"/>
</StringArray>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Anzahl an Tagen, f&#xfc;r welche Nachrichten geladen werden"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmbDownloadMailsActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmbDownloadInstantMessagesActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
Expand Down Expand Up @@ -254,7 +259,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="426" max="32767" attributes="0"/>
<EmptySpace min="0" pref="428" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
Expand Down Expand Up @@ -291,7 +296,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="426" max="32767" attributes="0"/>
<EmptySpace min="0" pref="428" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
Expand All @@ -316,5 +321,19 @@
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblClearHashtagSelectionMouseClicked"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lblPopoutMessenger">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons32/material/baseline_open_in_new_white_48dp.png"/>
</Property>
<Property name="text" type="java.lang.String" value=" "/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Handcursor"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblPopoutMessengerMouseClicked"/>
</Events>
</Component>
</SubComponents>
</Form>
Loading

0 comments on commit d1ea9d2

Please sign in to comment.