<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>chat.html</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -9,21 +9,22 @@
 #import &lt;UIKit/UIKit.h&gt;
 
 @class Conversation;
+@class Message;
 
 @interface ConversationController : UIViewController {
     UINavigationController *navigation;
-    IBOutlet UITableView *display;
+    IBOutlet UIWebView *display;
     
     NSMutableArray *messages;
     Conversation *conversation;
 }
 
 @property(nonatomic, retain) UINavigationController *navigation;
-@property(nonatomic, retain) UITableView *display;
+@property(nonatomic, retain) UIWebView *display;
 
 - (ConversationController*)initWithConversation:(Conversation*)theConversation;
 
-- (void)reloadMessages;
+- (void)reloadMessages:(Message*)lastMessage;
 - (void)loadMoreMessages;
 
 @end</diff>
      <filename>Classes/Controllers/ConversationController.h</filename>
    </modified>
    <modified>
      <diff>@@ -30,17 +30,20 @@
 
 - (void)listen
 {
-    //[[NSNotificationCenter defaultCenter] removeObserver:self];
-    //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dataLoaded:) name:@&quot;HomeListLoaded&quot; object:nil];
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dataLoaded:) name:@&quot;ConversationLoaded&quot; object:nil];
 }
-/*
+
 - (void)dataLoaded:(NSNotification*)sender
 {
-    if (bookmarkedConversations)
-        [bookmarkedConversations release];
-    bookmarkedConversations = [(NSArray*)[sender.userInfo objectForKey:@&quot;list&quot;] retain];
-    [display reloadData];
-}*/
+    [display stringByEvaluatingJavaScriptFromString:@&quot;Chat.clear();&quot;];
+    for (Message *message in messages) {
+        NSString *evalStr = [NSString stringWithFormat:@&quot;Chat.message('%@', '%@');&quot;, [message.user.name stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [message.messageHtml stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+        //NSLog(@&quot;Eval: %@&quot;, evalStr);
+        [display stringByEvaluatingJavaScriptFromString:evalStr];
+        //break;
+    }
+}
 
 /*
  // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
@@ -65,12 +68,22 @@
     
     self.navigationItem.title = conversation.name;
     
-    [self reloadMessages];
+    NSString *content = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@&quot;chat&quot; ofType:@&quot;html&quot;] encoding:NSUTF8StringEncoding  error:nil];
+    [display loadHTMLString:content baseURL:[NSURL URLWithString:@&quot;http://localhost&quot;]];
+    
+    [self reloadMessages:nil];
+}
+
+- (void)reloadMessages:(Message*)lastMessage
+{
+    [[ConnectionManager sharedInstance] runJob:@selector(doGrabMessages:) onTarget:self withArgument:lastMessage];
 }
 
-- (void)reloadMessages
+- (void)postNotification:(Message*)lastMessage
 {
-    [[ConnectionManager sharedInstance] runJob:@selector(doGrabMessages:) onTarget:self withArgument:nil];
+    [[NSNotificationCenter defaultCenter] postNotificationName:@&quot;ConversationLoaded&quot;
+                                                        object:self
+                                                      userInfo:[NSDictionary dictionaryWithObjectsAndKeys:lastMessage, @&quot;lastMessage&quot;, nil]];
 }
 
 - (void)doGrabMessages:(Message*)lastMessage
@@ -86,69 +99,30 @@
             messages = [[NSMutableArray arrayWithArray:theMessages] retain];
         }
         
-        [display reloadData];
-    } else {
-        // Disable more messages?
-    }
-}
-
-- (void)loadMoreMessages
-{
-    Message *lastMessage = [messages lastObject];
-    NSArray *theMessages = [conversation messagesSince:lastMessage];
-    
-    if (messages) {
-        // NOTE: probably should insert dynamically into table
-        [messages addObjectsFromArray:theMessages];
-        [display reloadData];
+        // invoke notification in main thread
+        [self performSelectorOnMainThread:@selector(postNotification:) withObject:lastMessage waitUntilDone:NO];
+        
     } else {
         // Disable more messages?
     }
 }
 
-- (UITableViewCellAccessoryType)tableView:(UITableView *)stableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath
+- (void)webViewDidStartLoad:(UIWebView *)theWebView
 {
-    return UITableViewCellAccessoryNone;
 }
 
-- (void)tableView:(UITableView *)stableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
 {
-    // ...
-}
-
-
-NSString *kMCell = @&quot;MCELL&quot;;
-
-- (UITableViewCell *)tableView:(UITableView *)stableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    int row = indexPath.row;
-    
-    UITableViewCell *cell = [stableView dequeueReusableCellWithIdentifier:kMCell];
-    
-    if (cell == nil) {
-        cell = [[UITableViewCell alloc] initWithFrame:CGRectNull];
+    if ([[request.URL host] isEqual:@&quot;localhost&quot;]) {
+        return YES;
+    } else {
+        [[UIApplication sharedApplication] openURL:request.URL];
+        return NO;
     }
-    
-    Message *message = [messages objectAtIndex:row];
-    User *user = message.user;
-    cell.text = [NSString stringWithFormat:@&quot;%@: %@&quot;, user.name, message.message];
-    
-    return cell;
-}
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)stableView
-{
-    return 1;
-}
-
-- (NSString *)tableView:(UITableView *)stableView titleForHeaderInSection:(NSInteger)section
-{
-    return nil;
 }
 
-- (NSInteger)tableView:(UITableView *)stableView numberOfRowsInSection:(NSInteger)section
+- (void)webViewDidFinishLoad:(UIWebView *)theWebView
 {
-    return [messages count];
 }
 
 /*</diff>
      <filename>Classes/Controllers/ConversationController.m</filename>
    </modified>
    <modified>
      <diff>@@ -36,25 +36,19 @@
 				&lt;int key=&quot;NSvFlags&quot;&gt;292&lt;/int&gt;
 				&lt;object class=&quot;NSMutableArray&quot; key=&quot;NSSubviews&quot;&gt;
 					&lt;bool key=&quot;EncodedWithXMLCoder&quot;&gt;YES&lt;/bool&gt;
-					&lt;object class=&quot;IBUITableView&quot; id=&quot;116006357&quot;&gt;
+					&lt;object class=&quot;IBUIWebView&quot; id=&quot;998323467&quot;&gt;
 						&lt;reference key=&quot;NSNextResponder&quot; ref=&quot;191373211&quot;/&gt;
 						&lt;int key=&quot;NSvFlags&quot;&gt;274&lt;/int&gt;
 						&lt;string key=&quot;NSFrameSize&quot;&gt;{320, 372}&lt;/string&gt;
 						&lt;reference key=&quot;NSSuperview&quot; ref=&quot;191373211&quot;/&gt;
 						&lt;object class=&quot;NSColor&quot; key=&quot;IBUIBackgroundColor&quot;&gt;
-							&lt;int key=&quot;NSColorSpace&quot;&gt;3&lt;/int&gt;
-							&lt;bytes key=&quot;NSWhite&quot;&gt;MQA&lt;/bytes&gt;
+							&lt;int key=&quot;NSColorSpace&quot;&gt;1&lt;/int&gt;
+							&lt;bytes key=&quot;NSRGB&quot;&gt;MSAxIDEAA&lt;/bytes&gt;
 						&lt;/object&gt;
-						&lt;bool key=&quot;IBUIOpaque&quot;&gt;NO&lt;/bool&gt;
 						&lt;bool key=&quot;IBUIClipsSubviews&quot;&gt;YES&lt;/bool&gt;
-						&lt;bool key=&quot;IBUIClearsContextBeforeDrawing&quot;&gt;NO&lt;/bool&gt;
-						&lt;bool key=&quot;IBUIBouncesZoom&quot;&gt;NO&lt;/bool&gt;
-						&lt;int key=&quot;IBUISeparatorStyle&quot;&gt;1&lt;/int&gt;
-						&lt;int key=&quot;IBUISectionIndexMinimumDisplayRowCount&quot;&gt;0&lt;/int&gt;
-						&lt;bool key=&quot;IBUIShowsSelectionImmediatelyOnTouchBegin&quot;&gt;YES&lt;/bool&gt;
-						&lt;float key=&quot;IBUIRowHeight&quot;&gt;4.400000e+01&lt;/float&gt;
-						&lt;float key=&quot;IBUISectionHeaderHeight&quot;&gt;2.200000e+01&lt;/float&gt;
-						&lt;float key=&quot;IBUISectionFooterHeight&quot;&gt;2.200000e+01&lt;/float&gt;
+						&lt;bool key=&quot;IBUIMultipleTouchEnabled&quot;&gt;YES&lt;/bool&gt;
+						&lt;int key=&quot;IBUIDataDetectorTypes&quot;&gt;1&lt;/int&gt;
+						&lt;bool key=&quot;IBUIDetectsPhoneNumbers&quot;&gt;YES&lt;/bool&gt;
 					&lt;/object&gt;
 				&lt;/object&gt;
 				&lt;string key=&quot;NSFrameSize&quot;&gt;{320, 372}&lt;/string&gt;
@@ -78,14 +72,6 @@
 				&lt;bool key=&quot;EncodedWithXMLCoder&quot;&gt;YES&lt;/bool&gt;
 				&lt;object class=&quot;IBConnectionRecord&quot;&gt;
 					&lt;object class=&quot;IBCocoaTouchOutletConnection&quot; key=&quot;connection&quot;&gt;
-						&lt;string key=&quot;label&quot;&gt;display&lt;/string&gt;
-						&lt;reference key=&quot;source&quot; ref=&quot;372490531&quot;/&gt;
-						&lt;reference key=&quot;destination&quot; ref=&quot;116006357&quot;/&gt;
-					&lt;/object&gt;
-					&lt;int key=&quot;connectionID&quot;&gt;4&lt;/int&gt;
-				&lt;/object&gt;
-				&lt;object class=&quot;IBConnectionRecord&quot;&gt;
-					&lt;object class=&quot;IBCocoaTouchOutletConnection&quot; key=&quot;connection&quot;&gt;
 						&lt;string key=&quot;label&quot;&gt;view&lt;/string&gt;
 						&lt;reference key=&quot;source&quot; ref=&quot;372490531&quot;/&gt;
 						&lt;reference key=&quot;destination&quot; ref=&quot;191373211&quot;/&gt;
@@ -94,19 +80,19 @@
 				&lt;/object&gt;
 				&lt;object class=&quot;IBConnectionRecord&quot;&gt;
 					&lt;object class=&quot;IBCocoaTouchOutletConnection&quot; key=&quot;connection&quot;&gt;
-						&lt;string key=&quot;label&quot;&gt;dataSource&lt;/string&gt;
-						&lt;reference key=&quot;source&quot; ref=&quot;116006357&quot;/&gt;
-						&lt;reference key=&quot;destination&quot; ref=&quot;372490531&quot;/&gt;
+						&lt;string key=&quot;label&quot;&gt;display&lt;/string&gt;
+						&lt;reference key=&quot;source&quot; ref=&quot;372490531&quot;/&gt;
+						&lt;reference key=&quot;destination&quot; ref=&quot;998323467&quot;/&gt;
 					&lt;/object&gt;
-					&lt;int key=&quot;connectionID&quot;&gt;6&lt;/int&gt;
+					&lt;int key=&quot;connectionID&quot;&gt;9&lt;/int&gt;
 				&lt;/object&gt;
 				&lt;object class=&quot;IBConnectionRecord&quot;&gt;
 					&lt;object class=&quot;IBCocoaTouchOutletConnection&quot; key=&quot;connection&quot;&gt;
 						&lt;string key=&quot;label&quot;&gt;delegate&lt;/string&gt;
-						&lt;reference key=&quot;source&quot; ref=&quot;116006357&quot;/&gt;
+						&lt;reference key=&quot;source&quot; ref=&quot;998323467&quot;/&gt;
 						&lt;reference key=&quot;destination&quot; ref=&quot;372490531&quot;/&gt;
 					&lt;/object&gt;
-					&lt;int key=&quot;connectionID&quot;&gt;7&lt;/int&gt;
+					&lt;int key=&quot;connectionID&quot;&gt;11&lt;/int&gt;
 				&lt;/object&gt;
 			&lt;/object&gt;
 			&lt;object class=&quot;IBMutableOrderedSet&quot; key=&quot;objectRecords&quot;&gt;
@@ -125,7 +111,7 @@
 						&lt;reference key=&quot;object&quot; ref=&quot;191373211&quot;/&gt;
 						&lt;object class=&quot;NSMutableArray&quot; key=&quot;children&quot;&gt;
 							&lt;bool key=&quot;EncodedWithXMLCoder&quot;&gt;YES&lt;/bool&gt;
-							&lt;reference ref=&quot;116006357&quot;/&gt;
+							&lt;reference ref=&quot;998323467&quot;/&gt;
 						&lt;/object&gt;
 						&lt;reference key=&quot;parent&quot; ref=&quot;568575992&quot;/&gt;
 					&lt;/object&gt;
@@ -141,8 +127,8 @@
 						&lt;reference key=&quot;parent&quot; ref=&quot;568575992&quot;/&gt;
 					&lt;/object&gt;
 					&lt;object class=&quot;IBObjectRecord&quot;&gt;
-						&lt;int key=&quot;objectID&quot;&gt;3&lt;/int&gt;
-						&lt;reference key=&quot;object&quot; ref=&quot;116006357&quot;/&gt;
+						&lt;int key=&quot;objectID&quot;&gt;8&lt;/int&gt;
+						&lt;reference key=&quot;object&quot; ref=&quot;998323467&quot;/&gt;
 						&lt;reference key=&quot;parent&quot; ref=&quot;191373211&quot;/&gt;
 					&lt;/object&gt;
 				&lt;/object&gt;
@@ -155,7 +141,7 @@
 					&lt;string&gt;-2.CustomClassName&lt;/string&gt;
 					&lt;string&gt;1.IBEditorWindowLastContentRect&lt;/string&gt;
 					&lt;string&gt;1.IBPluginDependency&lt;/string&gt;
-					&lt;string&gt;3.IBPluginDependency&lt;/string&gt;
+					&lt;string&gt;8.IBPluginDependency&lt;/string&gt;
 				&lt;/object&gt;
 				&lt;object class=&quot;NSMutableArray&quot; key=&quot;dict.values&quot;&gt;
 					&lt;bool key=&quot;EncodedWithXMLCoder&quot;&gt;YES&lt;/bool&gt;
@@ -186,7 +172,7 @@
 				&lt;/object&gt;
 			&lt;/object&gt;
 			&lt;nil key=&quot;sourceID&quot;/&gt;
-			&lt;int key=&quot;maxID&quot;&gt;7&lt;/int&gt;
+			&lt;int key=&quot;maxID&quot;&gt;11&lt;/int&gt;
 		&lt;/object&gt;
 		&lt;object class=&quot;IBClassDescriber&quot; key=&quot;IBDocument.Classes&quot;&gt;
 			&lt;object class=&quot;NSMutableArray&quot; key=&quot;referencedPartialClassDescriptions&quot;&gt;
@@ -196,7 +182,7 @@
 					&lt;string key=&quot;superclassName&quot;&gt;UIViewController&lt;/string&gt;
 					&lt;object class=&quot;NSMutableDictionary&quot; key=&quot;outlets&quot;&gt;
 						&lt;string key=&quot;NS.key.0&quot;&gt;display&lt;/string&gt;
-						&lt;string key=&quot;NS.object.0&quot;&gt;UITableView&lt;/string&gt;
+						&lt;string key=&quot;NS.object.0&quot;&gt;UIWebView&lt;/string&gt;
 					&lt;/object&gt;
 					&lt;object class=&quot;IBClassDescriptionSource&quot; key=&quot;sourceIdentifier&quot;&gt;
 						&lt;string key=&quot;majorKey&quot;&gt;IBProjectSource&lt;/string&gt;</diff>
      <filename>Classes/Conversation.xib</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,7 @@
 @interface Message : NSObject {
     NSString *messageId;
     NSString *message;
+    NSString *messageHtml;
     NSString *userId;  // string so we can lookup in hash easily!
 }
 
@@ -20,6 +21,7 @@
 
 @property(nonatomic, copy) NSString *messageId;
 @property(nonatomic, copy) NSString *message;
+@property(nonatomic, copy) NSString *messageHtml;
 @property(nonatomic, retain) NSString *userId;
 
 @end</diff>
      <filename>Classes/Models/Message.h</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,7 @@
 
 @synthesize messageId;
 @synthesize message;
+@synthesize messageHtml;
 @synthesize userId;
 
 @dynamic user;
@@ -42,6 +43,7 @@
 - (void)dealloc {
     [messageId release];
     [message release];
+    [messageHtml release];
     [userId release];
     
     [super dealloc];</diff>
      <filename>Classes/Models/Message.m</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@
 @dynamic token;
 @synthesize auth;
 
-//#define USE_ECHOWAVES
+#define USE_ECHOWAVES
 
 #ifdef USE_ECHOWAVES
 // ew.com
@@ -122,7 +122,7 @@
                        @&quot;http://www.echowaves.com/oauth/request_token&quot;, @&quot;AUTHTOKENURL&quot;,
                        @&quot;http://www.echowaves.com/oauth/authorize&quot;, @&quot;AUTHURL&quot;,
                        @&quot;http://www.echowaves.com/oauth/access_token&quot;, @&quot;ACCESSTOKENURL&quot;,
-                       @&quot;http://www.echowaves.com/oauth/authorize/echochat&quot;, @&quot;CALLBACKURL&quot;, nil]];
+                       @&quot;http://echowaves.com/oauth/authorize/echochat&quot;, @&quot;CALLBACKURL&quot;, nil]];
 #else                       
                        @&quot;http://localhost:3000/oauth/request_token&quot;, @&quot;AUTHTOKENURL&quot;,
                        @&quot;http://localhost:3000/oauth/authorize&quot;, @&quot;AUTHURL&quot;,</diff>
      <filename>Classes/echochatAppDelegate.m</filename>
    </modified>
    <modified>
      <diff>@@ -69,6 +69,7 @@
 		32817E810FF817BC00568251 /* OAToken_KeychainExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 32817E610FF817BC00568251 /* OAToken_KeychainExtensions.m */; };
 		32B552C910009944006E42A4 /* Conversation.xib in Resources */ = {isa = PBXBuildFile; fileRef = 32B552C810009944006E42A4 /* Conversation.xib */; };
 		32B5536F1000AD38006E42A4 /* ConnectionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32B5536E1000AD38006E42A4 /* ConnectionManager.m */; };
+		32B554D51000DC48006E42A4 /* chat.html in Resources */ = {isa = PBXBuildFile; fileRef = 32B554D41000DC48006E42A4 /* chat.html */; };
 		32CD757C0F7A2A5300B46E71 /* SettingsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 32CD757B0F7A2A5300B46E71 /* SettingsController.m */; };
 		32CD75CE0F7A2FCA00B46E71 /* EditCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 32CD75CD0F7A2FCA00B46E71 /* EditCell.m */; };
 		32CD76F40F7A437500B46E71 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 32CD76F00F7A437500B46E71 /* MainWindow.xib */; };
@@ -209,6 +210,7 @@
 		32B552C810009944006E42A4 /* Conversation.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Conversation.xib; sourceTree = &quot;&lt;group&gt;&quot;; };
 		32B5536D1000AD38006E42A4 /* ConnectionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectionManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
 		32B5536E1000AD38006E42A4 /* ConnectionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConnectionManager.m; sourceTree = &quot;&lt;group&gt;&quot;; };
+		32B554D41000DC48006E42A4 /* chat.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = chat.html; sourceTree = &quot;&lt;group&gt;&quot;; };
 		32CD757A0F7A2A5300B46E71 /* SettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SettingsController.h; path = ../SettingsController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
 		32CD757B0F7A2A5300B46E71 /* SettingsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SettingsController.m; path = ../SettingsController.m; sourceTree = &quot;&lt;group&gt;&quot;; };
 		32CD75CC0F7A2FCA00B46E71 /* EditCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditCell.h; sourceTree = &quot;&lt;group&gt;&quot;; };
@@ -284,6 +286,7 @@
 		29B97317FDCFA39411CA2CEA /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				32B554D41000DC48006E42A4 /* chat.html */,
 				CAE1E5220F79867200182BE9 /* icon.png */,
 				8D1107310486CEB800E47090 /* Info.plist */,
 				325A53790FF8CE090049D26C /* OpenAuthLogin.xib */,
@@ -580,6 +583,7 @@
 				32CD76F50F7A437500B46E71 /* SettingsController.xib in Resources */,
 				325A537A0FF8CE090049D26C /* OpenAuthLogin.xib in Resources */,
 				32B552C910009944006E42A4 /* Conversation.xib in Resources */,
+				32B554D51000DC48006E42A4 /* chat.html in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};</diff>
      <filename>echochat.xcodeproj/project.pbxproj</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6352135653f7545b585a73f635670ce7fae53280</id>
    </parent>
  </parents>
  <author>
    <name>jamesu</name>
    <email>jamesu@gmail.com</email>
  </author>
  <url>http://github.com/jamesu/echochat/commit/099236e6e43ec2436c1e21ca225c5355134a83c9</url>
  <id>099236e6e43ec2436c1e21ca225c5355134a83c9</id>
  <committed-date>2009-07-05T06:53:10-07:00</committed-date>
  <authored-date>2009-07-05T06:53:10-07:00</authored-date>
  <message>Changed message list to a more sensible UIWebView</message>
  <tree>f746aaf2b296f016a7396a84a9259df6239dbbb5</tree>
  <committer>
    <name>jamesu</name>
    <email>jamesu@gmail.com</email>
  </committer>
</commit>
