Skip to content

Commit

Permalink
toggles read, rather than iterates, updated readme (1.0!)
Browse files Browse the repository at this point in the history
  • Loading branch information
insanj committed Feb 25, 2014
1 parent 7264b7e commit de78300
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
46 changes: 19 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,23 @@ Unread

Hold to mark Messages threads as unread.

---------------------------------------
Simplified BSD License
Copyright (c) 2014, Julian Weiss
All rights reserved.
---------------------------------------
[Creative Commons Attribution-NonCommercial 3.0 United States License](http://creativecommons.org/licenses/by-nc/3.0/us/) as of 2014:

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
Creative Commons Attribution-NonCommercial 3.0 United States License
Please visit above link for full license.
Human-readable summary of your abilities has been transcribed below.

You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial — You may not use the material for commercial purposes.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
6 changes: 3 additions & 3 deletions Unread.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
@end

@interface CKConversationListCell : UITableViewCell
@property(retain) NSDate * searchMessageDate;
@property(copy) NSString * searchMessageGUID;
@property(copy) NSString * searchSummaryText;
@property(retain) NSDate *searchMessageDate;
@property(copy) NSString *searchMessageGUID;
@property(copy) NSString *searchSummaryText;
@end

@interface CKConversationList : NSObject
Expand Down
14 changes: 11 additions & 3 deletions Unread.xm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@
UITableView *table = MSHookIvar<UITableView *>(self, "_table");
CKConversation *conversation = [[[%c(CKConversationList) sharedConversationList] conversations] objectAtIndex:[table indexPathForCell:cell].row];

NSLog(@"[Unread] Detected long-press on %@, marking %@ as unread.", cell, conversation);
[conversation.chat _setDBUnreadCount:conversation.unreadCount+1];
[self _chatUnreadCountDidChange:conversation.chat];
if(conversation.unreadCount == 0){
NSLog(@"[Unread] Detected long-press on %@, marking %@ as unread...", cell, conversation);
[conversation.chat _setDBUnreadCount:conversation.unreadCount+1];
[self _chatUnreadCountDidChange:conversation.chat];
}

else{
NSLog(@"[Unread] Detected long-press on %@, marking %@ as read...", cell, conversation);
[conversation.chat _setDBUnreadCount:0];
[self _chatUnreadCountDidChange:conversation.chat];
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions control
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Package: com.insanj.unread
Name: Unread
Pre-Depends: firmware (>= 7.0)
Depends: mobilesubstrate
Version: 0.1
Version: 1.0
Architecture: iphoneos-arm
Description: Hold to mark Messages threads as unread.
Description: Hold to mark Messages as (un)read.
Maintainer: Julian Weiss <insanjmail@gmail.com>
Author: Julian (insanj) Weiss
Section: Tweaks

0 comments on commit de78300

Please sign in to comment.