Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
Fix duplicate quick replies (closes #22)
Browse files Browse the repository at this point in the history
  • Loading branch information
jariz committed Sep 14, 2016
1 parent f73f8fb commit 326dbc8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Noti/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.2</string>
<string>0.1.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5</string>
<string>7</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down
9 changes: 8 additions & 1 deletion Noti/PushManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,18 @@ class PushManager: NSObject, WebSocketDelegate, NSUserNotificationCenterDelegate
let body = notification.response?.string

func doQuickReply() {
var indexToBeRemoved = -1, i = -1;
for item in pushHistory {
i += 1;
if item["notification_id"].string == notification.identifier && item["type"].string == "mirror" {
ephemerals.quickReply(item, reply: body!)
ephemerals.quickReply(item, reply: body!);
indexToBeRemoved = i;
break;
}
}
if(indexToBeRemoved != -1) {
pushHistory.removeAtIndex(indexToBeRemoved)
}
}

//determine if we replied to a sms or a normal notification
Expand Down

0 comments on commit 326dbc8

Please sign in to comment.