Skip to content

Commit

Permalink
Pidgin From: Fixes for 12 AM and 12 PM time handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Deltik committed Nov 8, 2020
1 parent 0f33e37 commit 4f3e126
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
15 changes: 9 additions & 6 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# !! IMPORTANT INFORMATION ! IMPORTANT INFORMATION ! IMPORTANT INFORMATION !! #
###############################################################################
# The Log2Log v1.x branch has been deprecated. This is the final release of #
# Log2Log v1.x (v1.0.8) as of 04 November 2020. You may ask for a customized #
# Log2Log v1.x (v1.0.9) as of 04 November 2020. You may ask for a customized #
# release; Deltik will help you support new format converters if you ask. #
# #
# Development is paused due to a lack of interest in the Log2Log project and #
Expand All @@ -29,11 +29,11 @@
╔═══════════════════════════════════════════╤═╤═╤═╗
║Information │-│■│X║
╟───────────────────────────────────────────┴─┴─┴─╢
║Version: 1.0.8 (v1.0.8) ║
║Version: 1.0.9 (v1.0.9) ║
║Website: https://www.deltik.org/ ║
║Information: https://log2log.sourceforge.io/ ║
║E-Mail: [email protected]
║Release Date: UNRELEASED
║Release Date: 2020-11-07
╚═════════════════════════════════════════════════╝

@@@@@@@@@@@@@@@@@@@@@@@@@
Expand Down Expand Up @@ -109,7 +109,7 @@ Install Log2Log in three easy steps:
++++++++++++++++++++++++++++++
+ CONFIGURATION AND FEATURES +
++++++++++++++++++++++++++++++
Log2Log v1.0.8 does not have any configurable options. Is there something you
Log2Log v1.0.9 does not have any configurable options. Is there something you
want to be configurable? Suggest it to the project manager (email address in the
"More Information" section)!

Expand Down Expand Up @@ -180,10 +180,10 @@ converter compatibility, see the "Configuration and Features" section.
2. Converting chat log formats is no easy task. Note that Log2Log converters
might not be 100% successful at converting chat logs.

3. Time zone compatibility is rough as of v1.0.8.
3. Time zone compatibility is rough as of v1.0.9.

4. Languages other than English have not been figured out for format
converters as of v1.0.8. The Log2Log team would greatly appreciate it if
converters as of v1.0.9. The Log2Log team would greatly appreciate it if
you could develop a translation system for us.

5. This project would like help. If you would like to contribute to Log2Log in
Expand All @@ -206,6 +206,9 @@ You can contact the developer, too: <[email protected]>
+++++++++++++++++++
+ VERSION HISTORY +
+++++++++++++++++++
1.0.9 (2020-11-07)
- FIX: Pidgin `From` format converter handled neither 12 AM nor 12 PM correctly

1.0.8 (2020-11-04)
- FIX: Pidgin `From` format converter did not handle 12:00:00 PM to 12:59:59 PM correctly
- FIX: Pidgin `To` format converter now presents the sender ID in each line if the provided alias is empty
Expand Down
20 changes: 12 additions & 8 deletions formats/pidgin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,10 @@ qlonglong Pidgin::interpretTime(QString input, qlonglong $time_base)
// Ridiculous hotfix for handling 12:00:00 PM to 12:59:59 PM
if (timePos + 1 < split.size() && time_proc.hour() == 12 &&
(
split[timePos+1].toLower().contains("pm") ||
split[timePos+1].toLower().contains("p.m") ||
split[timePos+1].toLower().contains("p m") ||
split[timePos+1].toLower().contains("post")
split[timePos+1].toLower().contains("am") ||
split[timePos+1].toLower().contains("a.m") ||
split[timePos+1].toLower().contains("a m") ||
split[timePos+1].toLower().contains("ante")
)
)
time_proc = time_proc.addSecs(-43200);
Expand All @@ -581,10 +581,14 @@ qlonglong Pidgin::interpretTime(QString input, qlonglong $time_base)
// MERIDIEM ADDER
// Try to match for "post meridiem"
// If matches, add 12 hours (43200000 milliseconds) to the final sum
if (input.toLower().contains("pm") ||
input.toLower().contains("p.m") ||
input.toLower().contains("p m") ||
input.toLower().contains("post"))
if (time_proc.hour() != 12 &&
(
input.toLower().contains("pm") ||
input.toLower().contains("p.m") ||
input.toLower().contains("p m") ||
input.toLower().contains("post")
)
)
time_sum += 43200000;

// DATE GUESSER
Expand Down
2 changes: 1 addition & 1 deletion update.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define VERSION "1.0.8"
#define VERSION "1.0.9"
#define DL_SOURCE "https://log2log.sourceforge.io/update/"

/**
Expand Down

0 comments on commit 4f3e126

Please sign in to comment.