Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ind.ie Projects
Heartbeat Cocoa
Commits
f519fe72
Unverified
Commit
f519fe72
authored
Aug 29, 2015
by
Aral Balkan
Browse files
Cleaned up some log statements.
parent
32669001
Changes
1
Hide whitespace changes
Inline
Side-by-side
Heartbeat/NativeNotification.swift
View file @
f519fe72
...
...
@@ -128,30 +128,19 @@ public class NativeNotification: NSObject, NSUserNotificationCenterDelegate
// Don’t display the notification if the app is active and the timeline that the message
// came in for is the timeline that is currently active.
//
println
(
"Current timeline ID:
\(
CurrentTimeline
.
id
)
"
)
let
applicationIsActive
:
Bool
=
NSApplication
.
sharedApplication
()
.
active
let
isConversationTimelineNotification
=
(
notificationType
==
PulseNotification
.
named
(
PulseNotification
.
ConversationTimelineUpdated
))
let
isAllFriendsTimelineNotification
=
(
notificationType
==
PulseNotification
.
named
(
PulseNotification
.
AllFriendsTimelineUpdated
))
println
(
"applicationIsActive:
\(
applicationIsActive
)
"
)
println
(
"isConversationTimelineNotification:
\(
isConversationTimelineNotification
)
"
)
println
(
"isAllFriendsTimelineNotification:
\(
isAllFriendsTimelineNotification
)
"
)
let
appIsActiveAndTheMessageIsForTheCurrentlyActiveConversationTimeline
=
(
applicationIsActive
&&
isConversationTimelineNotification
&&
fromPerson
==
CurrentTimeline
.
id
)
let
appIsActiveAndTheMessageIsForTheCurrentlyActiveAllFriendsTimeline
=
(
applicationIsActive
&&
isAllFriendsTimelineNotification
&&
CurrentTimeline
.
id
==
"allfriends"
)
println
(
"appIsActiveAndTheMessageIsForTheCurrentlyActiveConversationTimeline:
\(
appIsActiveAndTheMessageIsForTheCurrentlyActiveConversationTimeline
)
"
)
println
(
"appIsActiveAndTheMessageIsForTheCurrentlyActiveAllFriendsTimeline:
\(
appIsActiveAndTheMessageIsForTheCurrentlyActiveAllFriendsTimeline
)
"
)
let
shouldNotDisplayNativeNotification
=
(
appIsActiveAndTheMessageIsForTheCurrentlyActiveConversationTimeline
||
appIsActiveAndTheMessageIsForTheCurrentlyActiveAllFriendsTimeline
)
println
(
"shouldNotDisplayNativeNotification:
\(
shouldNotDisplayNativeNotification
)
"
)
if
shouldNotDisplayNativeNotification
{
println
(
"App is active and the message is for the currently active timeline: not showing native notification."
)
//
println("App is active and the message is for the currently active timeline: not showing native notification.")
return
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment