This repository has been archived by the owner on Nov 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Issue185 v2 #10
Closed
Closed
Issue185 v2 #10
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
aad8b8f
Issue 185_v2: Splitted messages are saved only once together
5a37d8e
Issue 185_v2: Splitted messages are saved only once together + modifi…
974315e
Issue 185_v2: Comments covered
9cde669
Issue 185_v2: Comments covered 2
7d71000
Issue 185_v2: new version in config
18d8785
Issue 185_v2: another update
b14f4d1
Issue 185_v2: comments modified
a5cff4b
Issue 185_v2: changes for rebase
5cedbdd
Issue 185_v2: Splitted messages are saved only once together
a275c59
Issue 185_v2: Splitted messages are saved only once together + modifi…
e877178
Issue 185_v2: Comments covered
911d681
Issue 185_v2: Comments covered 2
dac99b7
Issue 185_v2: new version in config
e2aa549
Issue 185_v2: another update
cc2f13b
Issue 185_v2: comments modified
21a048c
Issue 185_v2: changes for rebase
222a065
Issue 185_v2: changes for rebase
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ | |
import esmska.data.Config; | ||
import esmska.data.Gateways; | ||
import esmska.data.History; | ||
import esmska.data.History.Record; | ||
import esmska.data.Icons; | ||
import esmska.data.Log; | ||
import esmska.data.Queue; | ||
|
@@ -76,6 +77,7 @@ | |
import java.text.MessageFormat; | ||
import java.util.ArrayList; | ||
import java.util.Calendar; | ||
import java.util.ListIterator; | ||
import java.util.ResourceBundle; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
import javax.swing.JComponent; | ||
|
@@ -712,12 +714,29 @@ private boolean saveAll() { | |
|
||
/** Saves history of sent sms */ | ||
private void createHistory(SMS sms) { | ||
History.Record record = new History.Record(sms.getNumber(), sms.getText(), | ||
|
||
boolean match = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why exactly do you need this variable? You can easily distinguish whether you've found something based on |
||
if(sms.getId() != null){ | ||
List<Record> records = history.getRecords(); | ||
ListIterator<Record> li = records.listIterator(records.size()); | ||
while (li.hasPrevious()) { | ||
Record r = li.previous(); | ||
if (sms.getId().equals(r.getSmsId())) { | ||
r.setText(r.getText() + sms.getText()); | ||
r.setDate(null); | ||
match = true; | ||
break; | ||
} | ||
} | ||
} | ||
if(!match){ | ||
Record record = new Record(sms.getNumber(), sms.getText(), | ||
sms.getGateway(), sms.getName(), sms.getSenderNumber(), | ||
sms.getSenderName(), null); | ||
history.addRecord(record); | ||
sms.getSenderName(), null, sms.getId()); | ||
history.addRecord(record); | ||
} | ||
} | ||
|
||
/** save program configuration | ||
* @return true if saved ok; false otherwise | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,11 +125,12 @@ public static ArrayList<History.Record> importHistory(File file) throws Exceptio | |
String text = reader.get(4); | ||
String senderName = reader.get(5); | ||
String senderNumber = reader.get(6); | ||
String id = reader.get(7); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works, if you have an empty history. But people already have some history, and it doesn't contain "id" yet. So you need to convert their history into the new format first. Please have a look at |
||
|
||
Date date = df.parse(dateString); | ||
|
||
History.Record record = new History.Record(number, text, gateway, | ||
name, senderNumber, senderName, date); | ||
name, senderNumber, senderName, date, id); | ||
history.add(record); | ||
} catch (Exception e) { | ||
logger.severe("Invalid history record: " + reader.getRawRecord()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please better document what happens if you provide a real value and if you provide
null
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still applies. I imagine something like: