<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>BrightBerry-2.debug</filename>
    </added>
    <added>
      <filename>src/img/icon_friends.png</filename>
    </added>
    <added>
      <filename>src/mobi/bbhn/brightberry/BlockUserThread.java</filename>
    </added>
    <added>
      <filename>src/mobi/bbhn/brightberry/FriendAcceptThread.java</filename>
    </added>
    <added>
      <filename>src/mobi/bbhn/brightberry/FriendsList.java</filename>
    </added>
    <added>
      <filename>src/mobi/bbhn/brightberry/FriendsThread.java</filename>
    </added>
    <added>
      <filename>src/mobi/bbhn/brightberry/PendingFriends.java</filename>
    </added>
    <added>
      <filename>src/mobi/bbhn/brightberry/PendingFriendsList.java</filename>
    </added>
    <added>
      <filename>src/mobi/bbhn/brightberry/PendingFriendsThread.java</filename>
    </added>
    <added>
      <filename>src/mobi/bbhn/brightberry/SettingsScreen.java</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,6 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;classpath&gt;
-	&lt;classpathentry excluding=&quot;mobi/bbhn/brightberry/Friends.java|mobi/bbhn/brightberry/FriendsScreen.java&quot; kind=&quot;src&quot; path=&quot;src&quot;/&gt;
+	&lt;classpathentry kind=&quot;src&quot; path=&quot;src&quot;/&gt;
 	&lt;classpathentry kind=&quot;con&quot; path=&quot;org.eclipse.jdt.USER_LIBRARY/NET_RIM_BLACKBERRY&quot;/&gt;
 	&lt;classpathentry kind=&quot;src&quot; path=&quot;.tmp&quot;/&gt;
 	&lt;classpathentry kind=&quot;output&quot; path=&quot;bin&quot;/&gt;</diff>
      <filename>.classpath</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>BrightBerry-1.debug</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>BrightBerry.cod</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>BrightBerry.debug</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,23 @@
 Manifest-Version: 1.0
-MIDlet-Version: 0.2.5
-MIDlet-Jar-Size: 327578
+MIDlet-Version: 0.2.7
+MIDlet-Jar-Size: 383788
+RIM-COD-URL-2: BrightBerry-2.cod
 MicroEdition-Configuration: CLDC-1.1
 MIDlet-Jar-URL: BrightBerry.jar
-RIM-COD-Module-Dependencies: net_rim_cldc,net_rim_os,net_rim_bbapi_browser,net_rim_bbapi_invoke,net_rim_locationapi
+RIM-COD-Module-Dependencies: net_rim_cldc,net_rim_bbapi_browser,net_rim_bbapi_menuitem,net_rim_os,net_rim_bbapi_invoke,net_rim_locationapi
 RIM-COD-URL-1: BrightBerry-1.cod
-RIM-COD-SHA1-1: fe 32 47 c2 86 b7 9d fc 64 11 b2 a8 4b ea d1 77 62 f3 af 74
+RIM-COD-SHA1-2: 4c 51 0a 82 32 30 4f c3 3b db 02 a4 a2 4c 4a 37 e8 77 7d 61
+RIM-COD-SHA1-1: 43 a7 f9 fe 81 b7 cb cb 5d 47 44 a1 2d 87 d9 4e 2b 58 39 53
 RIM-MIDlet-Flags-1: 0
-RIM-COD-Size-1: 61308
+RIM-COD-Size-2: 20456
 RIM-COD-Module-Name: BrightBerry
+RIM-COD-Size-1: 62028
+RIM-COD-Size: 62516
 MIDlet-Name: BrightBerry
-RIM-COD-Size: 62048
-RIM-COD-Creation-Time: 1245535343
+RIM-COD-Creation-Time: 1246926959
 MIDlet-1: BrightBerry,img/BKIcon.jpg,
 RIM-COD-URL: BrightBerry.cod
 MIDlet-Description: Unofficial Blackberry app for Brightkite using the REST-API
-RIM-COD-SHA1: 8e b0 bd 0e 7f 53 f4 8c 50 50 36 23 8b 5c 8c 8f d7 21 96 e3
+RIM-COD-SHA1: 82 73 75 8a 69 98 7a 79 a5 7d 86 3d ee d3 c7 69 ee b9 56 eb
 MicroEdition-Profile: MIDP-2.0
 MIDlet-Vendor: Hallgren Networks</diff>
      <filename>BrightBerry.jad</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>BrightBerry.jar</filename>
    </modified>
    <modified>
      <diff>@@ -18,8 +18,6 @@ AutoRestart=0
 [DefFiles
 ]
 [DependencyFiles
-src\mobi\bbhn\brightberry\Friends.java
-src\mobi\bbhn\brightberry\FriendsScreen.java
 ]
 [DependsOn
 ]
@@ -31,6 +29,7 @@ src\img\BKIconNotify.jpg
 src\img\default_avatar.gif
 src\img\icon_checkin.gif
 src\img\icon_comments.gif
+src\img\icon_friends.png
 src\img\icon_happening.gif
 src\img\icon_mentions.gif
 src\img\icon_messages.gif
@@ -46,6 +45,7 @@ src\mobi\bbhn\brightberry\AboutScreen.java
 src\mobi\bbhn\brightberry\AvatarThread.java
 src\mobi\bbhn\brightberry\BkObjectScreen.java
 src\mobi\bbhn\brightberry\BkObjectThread.java
+src\mobi\bbhn\brightberry\BlockUserThread.java
 src\mobi\bbhn\brightberry\BrightBerry.java
 src\mobi\bbhn\brightberry\BrightBerryMain.java
 src\mobi\bbhn\brightberry\CheckInThread.java
@@ -66,15 +66,20 @@ src\mobi\bbhn\brightberry\DirectMessageSentDeleteThread.java
 src\mobi\bbhn\brightberry\DirectMessageSentList.java
 src\mobi\bbhn\brightberry\DirectMessageSentScreen.java
 src\mobi\bbhn\brightberry\DirectMessageSentThread.java
+src\mobi\bbhn\brightberry\FriendAcceptThread.java
 src\mobi\bbhn\brightberry\Friends.java
+src\mobi\bbhn\brightberry\FriendsList.java
 src\mobi\bbhn\brightberry\FriendsScreen.java
+src\mobi\bbhn\brightberry\FriendsThread.java
 src\mobi\bbhn\brightberry\HTTPPhoto.java
 src\mobi\bbhn\brightberry\ImageCache.java
 src\mobi\bbhn\brightberry\JournalListener.java
 src\mobi\bbhn\brightberry\LicenseScreen.java
 src\mobi\bbhn\brightberry\MainButton.java
 src\mobi\bbhn\brightberry\NetworkConfig.java
-src\mobi\bbhn\brightberry\OptionsScreen.java
+src\mobi\bbhn\brightberry\PendingFriends.java
+src\mobi\bbhn\brightberry\PendingFriendsList.java
+src\mobi\bbhn\brightberry\PendingFriendsThread.java
 src\mobi\bbhn\brightberry\Placemark.java
 src\mobi\bbhn\brightberry\PlacemarkCreateThread.java
 src\mobi\bbhn\brightberry\PlacemarkList.java
@@ -97,6 +102,7 @@ src\mobi\bbhn\brightberry\SearchPlaceThread.java
 src\mobi\bbhn\brightberry\SendDirectMessageScreen.java
 src\mobi\bbhn\brightberry\SendDirectMessageThread.java
 src\mobi\bbhn\brightberry\Settings.java
+src\mobi\bbhn\brightberry\SettingsScreen.java
 src\mobi\bbhn\brightberry\Stream.java
 src\mobi\bbhn\brightberry\StreamButton.java
 src\mobi\bbhn\brightberry\StreamList.java
@@ -138,4 +144,4 @@ Title=BrightBerry
 Type=0
 UserData=|src
 Vendor=Hallgren Networks
-Version=0.2.6
+Version=0.2.7</diff>
      <filename>BrightBerry.jdp</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 MIDlet-Name: BrightBerry
-MIDlet-Version: 0.2.6
+MIDlet-Version: 0.2.7
 MIDlet-Vendor: Hallgren Networks
 MIDlet-Description: Unofficial Blackberry app for Brightkite using the REST-API
 MIDlet-Jar-URL: BrightBerry.jar</diff>
      <filename>BrightBerry.rapc</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,27 @@
+=== 0.2.8 TODOs
+* New Features
+ * Viewing user details
+ * Viewing comments stream
+ * Sending friends requests
+ 
+=== 0.2.7
+* New Features
+ * You can now accept friend requests
+ * You can now view a list of your friends
+ * You can now block users in the direct messages received screen
+ * You can now block users in the direct messages sent screen
+ * You can now block users in the friend list
+ * Click a item in a stream will now bring up details about it. Instead of a menu
+ * You can now upload a photo from the native Blackberry file explorer
+ * Posting a photo will now show you a preview before you upload it
+ * Sending a direct message now shows you how much text you have left
+ 
+* Fixes
+ * Renamed OptionsScreen.java to SettingsScreen.java
+
+* Removed Features
+ * Debug from the Application Settings screen
+ 
 === 0.2.6
 * New Features
  * Deleting a post in the stream screen now doesn't refresh it just removed the array element</diff>
      <filename>CHANGELOG.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -28,14 +28,26 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSI
 OF SUCH DAMAGE.
 */
 
+import net.rim.blackberry.api.menuitem.ApplicationMenuItem;
+import net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository;
 import net.rim.device.api.applicationcontrol.ApplicationPermissions;
 import net.rim.device.api.applicationcontrol.ApplicationPermissionsManager;
+import net.rim.device.api.system.Application;
+import net.rim.device.api.system.ApplicationDescriptor;
+import net.rim.device.api.system.Bitmap;
 import net.rim.device.api.system.DeviceInfo;
 import net.rim.device.api.ui.Color;
+import net.rim.device.api.ui.Manager;
+import net.rim.device.api.ui.Screen;
+import net.rim.device.api.ui.Ui;
 import net.rim.device.api.ui.UiApplication;
+import net.rim.device.api.ui.UiEngine;
+import net.rim.device.api.ui.component.Dialog;
+import net.rim.device.api.ui.component.LabelField;
+import net.rim.device.api.ui.component.SeparatorField;
 
 public class BrightBerry extends UiApplication {
-	static String version = &quot;0.2.6-ALPHA&quot;;
+	static String version = &quot;0.2.7-ALPHA&quot;;
 	static String gmkey = &quot;ABQIAAAAyqsOf4y12VmEo_2G0kkmUxRpIJO9csrDHHCYF6wRDNKwcymzzRQrUdTZ3AkMMnIbfqA_JKHMK0MjHw&quot;;
 	static String useragent = &quot;BrightBerry &quot; + version;
 	static int itembgcolor = Color.WHITE;
@@ -47,8 +59,15 @@ public class BrightBerry extends UiApplication {
 	static int pendingFriends;
 	static int friendCount;
 	static int unreadMessages;
+	final static long RUNSTORE = 0xb1850218a6a07789L;
+	static ApplicationMenuItem imagemenu = new BrightBerryPhotoMenuItem();
+	static long locationToAddMenuItem = ApplicationMenuItemRepository.MENUITEM_FILE_EXPLORER;
+    static ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();
+    static ApplicationDescriptor app = ApplicationDescriptor.currentApplicationDescriptor();
 	
 	public static void main(String[] args) {
+        amir.addMenuItem(locationToAddMenuItem, imagemenu, app);
+        
 		BrightBerry instance = new BrightBerry();
 		instance.checkPermissions();
 		instance.checkPermissions();
@@ -78,14 +97,6 @@ public class BrightBerry extends UiApplication {
         	permissionsRequest = true;
         }
         
-        /*
-        int browserFilter = permissionsManager.getPermission(ApplicationPermissions.PERMISSION_BROWSER_FILTER);
-        if (browserFilter == ApplicationPermissions.VALUE_DENY) {
-        	newPermissions.addPermission(ApplicationPermissions.PERMISSION_BROWSER_FILTER);
-        	permissionsRequest = true;
-        }
-        */
-        
         int externalConnections = permissionsManager.getPermission(ApplicationPermissions.PERMISSION_EXTERNAL_CONNECTIONS);
         if (externalConnections == ApplicationPermissions.VALUE_DENY) {
         	newPermissions.addPermission(ApplicationPermissions.PERMISSION_EXTERNAL_CONNECTIONS);
@@ -148,4 +159,39 @@ public class BrightBerry extends UiApplication {
 	public static void setUnreadMessages(int count) {
 		BrightBerry.unreadMessages = count;
 	}
+    
+	private static class BrightBerryPhotoMenuItem extends ApplicationMenuItem {
+		BrightBerryPhotoMenuItem() {
+			super(20);
+		}
+		
+		public String toString() {
+			return &quot;Send To BrightBerry&quot;;
+		}
+		        
+		 public Object run(Object context) {
+			 String filename = context.toString().substring(7);
+			 if (filename.endsWith(&quot;.jpg&quot;) || filename.endsWith(&quot;.jpeg&quot;) || filename.endsWith(&quot;.gif&quot;) || filename.endsWith(&quot;.png&quot;) || filename.endsWith(&quot;.bmp&quot;)) {
+				 Application.getApplication().requestForeground();
+				 UiApplication.getUiApplication().pushScreen(new PostPhotoScreen(filename));
+			 } else {
+				 UiEngine _uiEngine = Ui.getUiEngine();
+				 Screen _screen = new Dialog(Dialog.D_OK, &quot;Warning:&quot;, Dialog.D_OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.VERTICAL_SCROLL);		
+				 LabelField _text = new LabelField(&quot;File type not supported&quot;);
+				 LabelField _pic = new LabelField(&quot;Brightkite supports JPEG, GIF, PNG, and BMP&quot;);
+				 _screen.add(_text);
+				 _screen.add(new SeparatorField());
+				 _screen.add(_pic);
+				 _uiEngine.pushGlobalScreen(_screen, 1, UiEngine.GLOBAL_QUEUE);
+			 }
+			 return context;
+		 } 
+	}
+
+	public static void removeMenus() {
+	    boolean remove = amir.removeMenuItem(locationToAddMenuItem, imagemenu);
+	    if (remove == false) {
+	    	System.out.println(&quot;Unable to remove item&quot;);
+	    }
+	}
 }
\ No newline at end of file</diff>
      <filename>src/mobi/bbhn/brightberry/BrightBerry.java</filename>
    </modified>
    <modified>
      <diff>@@ -56,6 +56,7 @@ public class BrightBerryMain extends MainScreen {
 	MainButton visitedplacesBtn = new MainButton(&quot;Visited Places&quot;, ButtonField.CONSUME_CLICK|ButtonField.FOCUSABLE);
 	MainButton placemarkBtn = new MainButton(&quot;Placemarks&quot;, ButtonField.CONSUME_CLICK|ButtonField.FOCUSABLE);
 	MainButton messagesBtn = new MainButton(&quot;Messages&quot;, ButtonField.CONSUME_CLICK|ButtonField.FOCUSABLE);
+	MainButton commentsBtn = new MainButton(&quot;Comments&quot;, ButtonField.CONSUME_CLICK|ButtonField.FOCUSABLE);
 	MainButton mentionsBtn = new MainButton(&quot;Mentions&quot;, ButtonField.CONSUME_CLICK|ButtonField.FOCUSABLE);
 	
 	MainButton actsettingsBtn = new MainButton(&quot;Account Settings&quot;, ButtonField.CONSUME_CLICK|ButtonField.FOCUSABLE);
@@ -115,7 +116,7 @@ public class BrightBerryMain extends MainScreen {
 		
 		FieldChangeListener AppSettingsListener = new FieldChangeListener() {
 			public void fieldChanged(Field field, int context) {
-				UiApplication.getUiApplication().pushScreen(new OptionsScreen());
+				UiApplication.getUiApplication().pushScreen(new SettingsScreen());
 			}
 		};
 		
@@ -125,6 +126,12 @@ public class BrightBerryMain extends MainScreen {
 			}
 		};
 		
+		FieldChangeListener FriendsListener = new FieldChangeListener() {
+			public void fieldChanged(Field field, int context) {
+				UiApplication.getUiApplication().pushScreen(new FriendsScreen(0));
+			}
+		};
+		
 		FieldChangeListener SignupListener = new FieldChangeListener() {
 			public void fieldChanged(Field field, int context) {
 				BrowserSession browserSession = Browser.getDefaultSession();
@@ -179,6 +186,7 @@ public class BrightBerryMain extends MainScreen {
 		
 		this.shutdownItem = new MenuItem(&quot;Shut down&quot;, 500, 10) {
 			public void run() {
+				BrightBerry.removeMenus();
 				System.exit(0);
 			}
 		};
@@ -208,6 +216,8 @@ public class BrightBerryMain extends MainScreen {
 	    		add(postphotoBtn);
 	    	}
 	    	add(new SeparatorField());
+	    	friendsBtn.setChangeListener(FriendsListener);
+	    	add(friendsBtn);
 	    	placemarkBtn.setChangeListener(PlacemarkListener);
 	    	add(placemarkBtn);
 	    	messagesBtn.setChangeListener(MessageListener);</diff>
      <filename>src/mobi/bbhn/brightberry/BrightBerryMain.java</filename>
    </modified>
    <modified>
      <diff>@@ -83,6 +83,8 @@ public class CheckInThread extends Thread {
 				((SearchPlaceScreen) this.screen).updateStatus(parseJSON(this.serverResponse));
 			} else if (this.caller.equals(&quot;stream&quot;)) {
 				((StreamScreen) this.screen).updateStatus(parseJSON(this.serverResponse));
+			} else if (this.caller.equals(&quot;friends&quot;)) {
+				((FriendsScreen) this.screen).updateStatus(parseJSON(this.serverResponse));
 			}
 		} catch (IOException ex) {
 		}</diff>
      <filename>src/mobi/bbhn/brightberry/CheckInThread.java</filename>
    </modified>
    <modified>
      <diff>@@ -52,5 +52,4 @@ public class CommentScreen extends MainScreen {
 		add(new SeparatorField());
 		add(new RichTextField(created + &quot; ago&quot;));
 	}
-	
 }
\ No newline at end of file</diff>
      <filename>src/mobi/bbhn/brightberry/CommentScreen.java</filename>
    </modified>
    <modified>
      <diff>@@ -42,6 +42,7 @@ class CommentsCallback implements ListFieldCallback {
 	public CommentsCallback(Comments[] comments) {
 		this.comments = comments;
 	}
+	
 	public void drawListRow(ListField list, Graphics g, int index, int y, int w) {
 		Font f = g.getFont();
 		int fontht = f.getHeight();
@@ -56,9 +57,11 @@ class CommentsCallback implements ListFieldCallback {
 	public Object get(ListField listField, int index) {
         return null;
     }
+	
     public int indexOfList(ListField listField, String prefix, int start) {
         return listField.indexOfList(prefix, start);
     }
+    
 	public int getPreferredWidth(ListField listField) {
 		return Display.getWidth();
 	}</diff>
      <filename>src/mobi/bbhn/brightberry/CommentsList.java</filename>
    </modified>
    <modified>
      <diff>@@ -54,10 +54,11 @@ public class DirectMessageRcvScreen extends MainScreen {
 			contextMenu.addItem(ViewStreamItem);
 			contextMenu.addItem(MenuItem.separator(4));
 			if (msglist.getSelection().length == 1) {
-			contextMenu.addItem(dlt1menuItem);
+				contextMenu.addItem(dlt1menuItem);
 			} else {
 				contextMenu.addItem(dltmanymenuItem);
 			}
+			contextMenu.addItem(blockItem);
 		}
 	};
 	DirectMessageRcv[] directMessage;
@@ -97,27 +98,42 @@ public class DirectMessageRcvScreen extends MainScreen {
 		}
 	};
 	
-	MenuItem sentItem = new MenuItem(&quot;Sent Messages&quot;, 7, 10) {
+	MenuItem blockItem = new MenuItem(&quot;Block User&quot;, 6, 10) {
+		public void run() {
+			if (DirectMessageRcvScreen.this.msglist.getSelectedIndex() &gt; -1) {
+				String username = directMessage[msglist.getSelectedIndex()].getSender();
+				int sure = Dialog.ask(Dialog.D_YES_NO, &quot;Are you sure you want to block &quot; + username + &quot;?&quot;);
+				if (Dialog.YES == sure) {
+					Thread blockThread = new BlockUserThread(username, DirectMessageRcvScreen.this);
+					blockThread.start();
+				}
+			} else {
+				Status.show(&quot;No user Selected&quot;);
+			}
+		}
+	};
+	
+	MenuItem sentItem = new MenuItem(&quot;Sent Messages&quot;, 8, 10) {
 		public void run() {
 			UiApplication.getUiApplication().pushScreen(new DirectMessageSentScreen(0));
 		}
 	};
 	
-	MenuItem nextItem = new MenuItem(&quot;Next &quot; + settings.getMaxMessages() + &quot; Messages&quot;, 9, 10) {
+	MenuItem nextItem = new MenuItem(&quot;Next &quot; + settings.getMaxMessages() + &quot; Messages&quot;, 10, 10) {
 		public void run() {
 			DirectMessageRcvScreen.this.start = DirectMessageRcvScreen.this.start + settings.getMaxMessages();
 			DirectMessageRcvScreen.this.refresh();
 		}
 	};
 	
-	MenuItem previousItem = new MenuItem(&quot;Previous &quot; + settings.getMaxMessages() + &quot; Messages&quot;, 10, 10) {
+	MenuItem previousItem = new MenuItem(&quot;Previous &quot; + settings.getMaxMessages() + &quot; Messages&quot;, 11, 10) {
 		public void run() {
 			DirectMessageRcvScreen.this.start = DirectMessageRcvScreen.this.start - settings.getMaxMessages();
 			DirectMessageRcvScreen.this.refresh();
 		}
 	};
 	
-	MenuItem refreshmenuItem = new MenuItem(&quot;Refresh&quot;, 12, 10) {
+	MenuItem refreshmenuItem = new MenuItem(&quot;Refresh&quot;, 13, 10) {
 		public void run() {
 			DirectMessageRcvScreen.this.refresh();
 		}
@@ -218,4 +234,21 @@ public class DirectMessageRcvScreen extends MainScreen {
 			}
 		});
 	}
+	
+	public void callBlocked(final boolean blocked) {
+		UiApplication.getUiApplication().invokeLater(
+				new Runnable() {
+					public void run() {
+						if (blocked == true) {
+							Status.show(&quot;User blocked&quot;);
+							if (UiApplication.getUiApplication().getActiveScreen() == DirectMessageRcvScreen.this) {
+								DirectMessageRcvScreen.this.refresh();
+							}
+						} else {
+							Status.show(&quot;Unable to block user&quot;);
+						}
+					}
+				}
+			);
+	}
 }
\ No newline at end of file</diff>
      <filename>src/mobi/bbhn/brightberry/DirectMessageRcvScreen.java</filename>
    </modified>
    <modified>
      <diff>@@ -58,6 +58,7 @@ public class DirectMessageSentScreen extends MainScreen {
 			} else {
 				contextMenu.addItem(dltmanyMenuItem);
 			}
+			contextMenu.addItem(blockItem);
 		}
 	};
 	DirectMessageSent[] directMessage;
@@ -96,6 +97,21 @@ public class DirectMessageSentScreen extends MainScreen {
 		}
 	};
 	
+	MenuItem blockItem = new MenuItem(&quot;Block User&quot;, 6, 10) {
+		public void run() {
+			if (DirectMessageSentScreen.this.msglist.getSelectedIndex() &gt; -1) {
+				String username = directMessage[msglist.getSelectedIndex()].getTo();
+				int sure = Dialog.ask(Dialog.D_YES_NO, &quot;Are you sure you want to block &quot; + username + &quot;?&quot;);
+				if (Dialog.YES == sure) {
+					Thread blockThread = new BlockUserThread(username, DirectMessageSentScreen.this);
+					blockThread.start();
+				}
+			} else {
+				Status.show(&quot;No user Selected&quot;);
+			}
+		}
+	};
+	
 	MenuItem nextItem = new MenuItem(&quot;Next &quot; + settings.getMaxMessages() + &quot; Messages&quot;, 7, 10) {
 		public void run() {
 			DirectMessageSentScreen.this.start = DirectMessageSentScreen.this.start + settings.getMaxMessages();
@@ -206,4 +222,21 @@ public class DirectMessageSentScreen extends MainScreen {
 			}
 		});
 	}
+	
+	public void callBlocked(final boolean blocked) {
+		UiApplication.getUiApplication().invokeLater(
+				new Runnable() {
+					public void run() {
+						if (blocked == true) {
+							Status.show(&quot;User blocked&quot;);
+							if (UiApplication.getUiApplication().getActiveScreen() == DirectMessageSentScreen.this) {
+								DirectMessageSentScreen.this.refresh();
+							}
+						} else {
+							Status.show(&quot;Unable to block user&quot;);
+						}
+					}
+				}
+			);
+	}
 }
\ No newline at end of file</diff>
      <filename>src/mobi/bbhn/brightberry/DirectMessageSentScreen.java</filename>
    </modified>
    <modified>
      <diff>@@ -36,27 +36,23 @@ public class Friends implements Comparator {
 	private String fullname;
 	private String last_active;
 	private String last_checkin;
-	private String last_location;
 	private String last_placeid;
 	private String last_placename;
 	private float last_latitude;
 	private float last_longitude;
-	private Bitmap avatar;
 
 	public Friends() {
 	}
 
-	public Friends(String username, String fullname, String last_active, String last_checkin, String last_location, String last_placeid, String last_placename, float last_latitude, float last_longitude, Bitmap avatar) {
+	public Friends(String username, String fullname, String last_active, String last_checkin, String last_placeid, String last_placename, float last_latitude, float last_longitude) {
 		this.username = username;
 		this.fullname = fullname;
 		this.last_active = last_active;
 		this.last_checkin = last_checkin;
-		this.last_location = last_location;
 		this.last_placeid = last_placeid;
 		this.last_placename = last_placename;
 		this.last_latitude = last_latitude;
 		this.last_longitude = last_longitude;
-		this.avatar = avatar;
 	}
 
 	public String getUsername() {
@@ -75,10 +71,6 @@ public class Friends implements Comparator {
 		return this.last_checkin;
 	}
 	
-	public String getLastLocation() {
-		return this.last_location;
-	}
-	
 	public String getLastPlaceID() {
 		return this.last_placeid;
 	}
@@ -96,7 +88,11 @@ public class Friends implements Comparator {
 	}
 	
 	public Bitmap getAvatar() {
-		return this.avatar;
+		if (ImageCache.inCache(this.username)) {
+			return ImageCache.getImage(this.username);
+		} else {
+			return Bitmap.getBitmapResource(&quot;img/default_avatar.gif&quot;);
+		}
 	}
 	
 	public int compare(Object Object1, Object Object2) {</diff>
      <filename>src/mobi/bbhn/brightberry/Friends.java</filename>
    </modified>
    <modified>
      <diff>@@ -32,11 +32,14 @@ import net.rim.blackberry.api.invoke.Invoke;
 import net.rim.blackberry.api.invoke.MapsArguments;
 import net.rim.device.api.ui.ContextMenu;
 import net.rim.device.api.ui.DrawStyle;
+import net.rim.device.api.ui.Font;
 import net.rim.device.api.ui.MenuItem;
 import net.rim.device.api.ui.UiApplication;
+import net.rim.device.api.ui.component.Dialog;
 import net.rim.device.api.ui.component.LabelField;
 import net.rim.device.api.ui.component.ListField;
 import net.rim.device.api.ui.component.RichTextField;
+import net.rim.device.api.ui.component.SeparatorField;
 import net.rim.device.api.ui.component.Status;
 import net.rim.device.api.ui.container.MainScreen;
 
@@ -46,32 +49,104 @@ public class FriendsScreen extends MainScreen {
 	Settings settings = Settings.getInstance();
 	String message;
 	FriendsScreen screen = this;
-	Placemark[] placemarks;
+	Friends[] friends;
+	PendingFriends[] pendingfriends;
 	MenuItem checkinItem;
-	ListField list = new PlacemarkListField();
+	ListField list = new FriendsListField();
+	ListField pendinglist = new PendingFriendsListField();
 	private MenuItem placestreamItem;
 	private MenuItem mapItem;
-	private MenuItem postnote;
-	private MenuItem postphoto;
+	private MenuItem userstream;
+	private MenuItem dmuser;
+	private int start;
+	private MenuItem refreshItem;
+	private MenuItem nextItem;
+	private MenuItem previousItem;
+	private MenuItem approveItem;
+	private MenuItem pendinguserstream;
+	private MenuItem pendingdmuser;
+	private MenuItem pendingblockItem;
+	private MenuItem blockItem;
 	protected boolean onSavePrompt() {
 		return true;
 	}
 
-	public FriendsScreen() {
-		Thread whereThread = new FriendsThread(this.screen);
-	    whereThread.start();
-	    
+	public FriendsScreen(int start) {
+		this.start = start;
+		Thread updateThread = new FriendsThread(FriendsScreen.this.screen, 10, this.start);
+		updateThread.start();
+		if (BrightBerry.getPendingFriends() &gt; 0) {
+			Thread pendingThread = new PendingFriendsThread(FriendsScreen.this.screen);
+			pendingThread.start();
+		}
+		
 		super.setTitle(new LabelField(&quot;BrightBerry Friends&quot;, 1152921504606846980L));
 		
-		this.checkinItem = new MenuItem(&quot;Checkin Here&quot;, 1, 10) {
+		this.approveItem = new MenuItem(&quot;Approve Friend Request&quot;, 1, 10) {
+			public void run() {
+				if (FriendsScreen.this.pendinglist.getSelectedIndex() &gt; -1) {
+					PendingFriends[] friends = FriendsScreen.this.pendingfriends;
+					String username = friends[FriendsScreen.this.pendinglist.getSelectedIndex()].getUsername();
+					int sure = Dialog.ask(Dialog.D_YES_NO, &quot;Are you sure you want to add &quot; + username + &quot; to your friend list?&quot;, Dialog.YES);
+					if (Dialog.YES == sure) {
+						Thread acceptThread = new FriendAcceptThread(username, FriendsScreen.this);
+						acceptThread.start();
+					}
+				} else {
+					Status.show(&quot;No Friend Selected&quot;);
+				}
+			}
+		};
+		
+		this.pendingblockItem = new MenuItem(&quot;Block User&quot;, 2, 10) {
+			public void run() {
+				if (FriendsScreen.this.pendinglist.getSelectedIndex() &gt; -1) {
+					PendingFriends[] friends = FriendsScreen.this.pendingfriends;
+					String username = friends[FriendsScreen.this.pendinglist.getSelectedIndex()].getUsername();
+					int sure = Dialog.ask(Dialog.D_YES_NO, &quot;Are you sure you want to block &quot; + username + &quot;?&quot;);
+					if (Dialog.YES == sure) {
+						Thread blockThread = new BlockUserThread(username, FriendsScreen.this);
+						blockThread.start();
+					}
+				} else {
+					Status.show(&quot;No Friend Selected&quot;);
+				}
+			}
+		};
+		
+		this.pendinguserstream = new MenuItem(&quot;View User Stream&quot;, 3, 10) {
+			public void run() {
+				if (FriendsScreen.this.list.getSelectedIndex() &gt; -1) {
+					PendingFriends[] friends = FriendsScreen.this.pendingfriends;
+					String username = friends[FriendsScreen.this.list.getSelectedIndex()].getUsername();
+					UiApplication.getUiApplication().pushScreen(new StreamScreen(true, &quot;person&quot;, 0, username));
+				} else {
+					Status.show(&quot;No Friend selected&quot;);
+				}
+			}
+		};
+		
+		this.pendingdmuser = new MenuItem(&quot;Send Direct Message&quot;, 4, 10) {
 			public void run() {
 				if (FriendsScreen.this.list.getSelectedIndex() &gt; -1) {
-					Placemark[] places = settings.getPlacemarks();
-					String id = places[FriendsScreen.this.list.getSelectedIndex()].getId();
-					Thread checkinThread = new CheckInThread(id, &quot;placemark&quot;, FriendsScreen.this.screen);
+					PendingFriends[] friends = FriendsScreen.this.pendingfriends;
+					String username = friends[FriendsScreen.this.list.getSelectedIndex()].getUsername();
+					UiApplication.getUiApplication().pushScreen(new SendDirectMessageScreen(username));
+				} else {
+					Status.show(&quot;No Friend selected&quot;);
+				}
+			}
+		};
+		
+		this.checkinItem = new MenuItem(&quot;Checkin at Friends Location&quot;, 1, 10) {
+			public void run() {
+				if (FriendsScreen.this.list.getSelectedIndex() &gt; -1) {
+					Friends[] friends = FriendsScreen.this.friends;
+					String id = friends[FriendsScreen.this.list.getSelectedIndex()].getLastPlaceID();
+					Thread checkinThread = new CheckInThread(id, &quot;friends&quot;, FriendsScreen.this.screen);
 					checkinThread.start();
 				} else {
-					Status.show(&quot;No Placemark selected&quot;);
+					Status.show(&quot;No Friend Selected&quot;);
 				}
 			}
 		};
@@ -79,92 +154,107 @@ public class FriendsScreen extends MainScreen {
 		this.placestreamItem = new MenuItem(&quot;View Place Stream&quot;, 2, 10) {
 			public void run() {
 				if (FriendsScreen.this.list.getSelectedIndex() &gt; -1) {
-					Placemark[] places = settings.getPlacemarks();
-					String placeid = places[FriendsScreen.this.list.getSelectedIndex()].getId();
-					String placename = places[FriendsScreen.this.list.getSelectedIndex()].getName();
-					float latitude = places[FriendsScreen.this.list.getSelectedIndex()].getLatitude();
-					float longitude = places[FriendsScreen.this.list.getSelectedIndex()].getLongitude();
+					Friends[] friends = FriendsScreen.this.friends;
+					String placeid = friends[FriendsScreen.this.list.getSelectedIndex()].getLastPlaceID();
+					String placename = friends[FriendsScreen.this.list.getSelectedIndex()].getLastPlaceName();
+					float latitude = friends[FriendsScreen.this.list.getSelectedIndex()].getLastLatitude();
+					float longitude = friends[FriendsScreen.this.list.getSelectedIndex()].getLastLongitude();
 					UiApplication.getUiApplication().pushScreen(new StreamScreen(true, &quot;place&quot;, 0, latitude, longitude, placeid, placename));
 				} else {
-					Status.show(&quot;No Placemark selected&quot;);
+					Status.show(&quot;No Friend selected&quot;);
 				}
 			}
 		};
 		
-		this.postnote = new MenuItem(&quot;Post Note About&quot;, 3, 10) {
+		this.userstream = new MenuItem(&quot;View User Stream&quot;, 3, 10) {
 			public void run() {
 				if (FriendsScreen.this.list.getSelectedIndex() &gt; -1) {
-					Placemark[] places = settings.getPlacemarks();
-					String placeid = places[FriendsScreen.this.list.getSelectedIndex()].getId();
-					String placename = places[FriendsScreen.this.list.getSelectedIndex()].getName();
-					UiApplication.getUiApplication().pushScreen(new PostNoteScreen(placeid, placename));
+					Friends[] friends = FriendsScreen.this.friends;
+					String username = friends[FriendsScreen.this.list.getSelectedIndex()].getUsername();
+					UiApplication.getUiApplication().pushScreen(new StreamScreen(true, &quot;person&quot;, 0, username));
 				} else {
-					Status.show(&quot;No Placemark selected&quot;);
+					Status.show(&quot;No Friend selected&quot;);
 				}
 			}
 		};
 		
-		this.postphoto = new MenuItem(&quot;Post Photo About&quot;, 4, 10) {
+		this.dmuser = new MenuItem(&quot;Send Direct Message&quot;, 4, 10) {
 			public void run() {
 				if (FriendsScreen.this.list.getSelectedIndex() &gt; -1) {
-					Placemark[] places = settings.getPlacemarks();
-					String placeid = places[FriendsScreen.this.list.getSelectedIndex()].getId();
-					String placename = places[FriendsScreen.this.list.getSelectedIndex()].getName();
-					UiApplication.getUiApplication().pushScreen(new PostPhotoScreen(placeid, placename));
+					Friends[] friends = FriendsScreen.this.friends;
+					String username = friends[FriendsScreen.this.list.getSelectedIndex()].getUsername();
+					UiApplication.getUiApplication().pushScreen(new SendDirectMessageScreen(username));
 				} else {
-					Status.show(&quot;No Placemark selected&quot;);
+					Status.show(&quot;No Friend selected&quot;);
 				}
 			}
 		};
 		
-		this.mapItem = new MenuItem(&quot;View on Blackberry Map&quot;, 5, 10) {
+		this.mapItem = new MenuItem(&quot;View Friend on Blackberry Map&quot;, 5, 10) {
 			public void run() {
 				if (FriendsScreen.this.list.getSelectedIndex() &gt; -1) {
-					Placemark[] places = settings.getPlacemarks();
-					float latitude = places[FriendsScreen.this.list.getSelectedIndex()].getLatitude();
-					float longitude = places[FriendsScreen.this.list.getSelectedIndex()].getLongitude();
-					String label = places[FriendsScreen.this.list.getSelectedIndex()].getName();
-					String description = places[FriendsScreen.this.list.getSelectedIndex()].getDisplayLocation();
+					Friends[] friends = FriendsScreen.this.friends;
+					float latitude = friends[FriendsScreen.this.list.getSelectedIndex()].getLastLatitude();
+					float longitude = friends[FriendsScreen.this.list.getSelectedIndex()].getLastLongitude();
+					String label = friends[FriendsScreen.this.list.getSelectedIndex()].getUsername();
+					String description = friends[FriendsScreen.this.list.getSelectedIndex()].getLastPlaceName();
 		            String location = &quot;&lt;lbs&gt;&quot; + &quot;&lt;location lat='&quot; + (int)(latitude*100000) + &quot;' lon='&quot; + (int)(longitude*100000) + &quot;' label='&quot; + label  +&quot;' description='&quot; + description + &quot;'/&gt;&quot; + &quot;&lt;/lbs&gt;&quot;;
 		            System.out.println(&quot;Location string: &quot; + location);
 		            Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments(MapsArguments.ARG_LOCATION_DOCUMENT, location));
 				} else {
-					Status.show(&quot;No Placemark selected&quot;);
+					Status.show(&quot;No Friend selected&quot;);
+				}
+			}
+		};
+		
+		this.blockItem = new MenuItem(&quot;Block User&quot;, 6, 10) {
+			public void run() {
+				if (FriendsScreen.this.list.getSelectedIndex() &gt; -1) {
+					Friends[] friends = FriendsScreen.this.friends;
+					String username = friends[FriendsScreen.this.list.getSelectedIndex()].getUsername();
+					int sure = Dialog.ask(Dialog.D_YES_NO, &quot;Are you sure you want to block &quot; + username + &quot;?&quot;);
+					if (Dialog.YES == sure) {
+						Thread blockThread = new BlockUserThread(username, FriendsScreen.this);
+						blockThread.start();
+					}
+				} else {
+					Status.show(&quot;No Friend Selected&quot;);
 				}
 			}
 		};
 		
-		this.updateItem = new MenuItem(&quot;Update Placemarks&quot;, 7, 10) {
+		this.nextItem = new MenuItem(&quot;Next page&quot;, 7, 10) {
 			public void run() {
-				Status.show(&quot;Updating placemarks&quot;);
-				Thread updateThread = new PlacemarksUpdateThread(FriendsScreen.this.screen);
-				updateThread.start();
+				FriendsScreen.this.start = FriendsScreen.this.start + 10;
+				FriendsScreen.this.refresh();
 			}
 		};
 		
-		this.whereAmIItem = new MenuItem(&quot;Where Am I&quot;, 8, 10) {
+		this.previousItem = new MenuItem(&quot;Previous page&quot;, 9, 10) {
 			public void run() {
-				Thread whereThread = new PlWhereAmIThread(FriendsScreen.this.screen);
-				whereThread.start();
+				FriendsScreen.this.start = FriendsScreen.this.start - 10;
+				FriendsScreen.this.refresh();
 			}
 		};
 		
-		addMenuItem(this.updateItem);
-		addMenuItem(this.whereAmIItem);
-		addMenuItem(MenuItem.separator(9));
+		this.refreshItem = new MenuItem(&quot;Refresh&quot;, 11, 10) {
+			public void run() {
+				FriendsScreen.this.refresh();
+			}
+		};
 		
-		if (settings.getPlacemarks() != null) {
-			this.list.setEmptyString(&quot;Nothing to see here&quot;, DrawStyle.LEFT);
-			this.list.setSize(settings.getPlacemarks().length);
-			this.list.setCallback(new PlacemarkCallback(settings.getPlacemarks()));
-			this.list.setRowHeight((int)(ListField.ROW_HEIGHT_FONT*2));
-			add(this.list);
-		} else {
-			RichTextField noresults = new RichTextField(&quot;You have no placemarks set&quot;, 45035996273704960L);
-			add(noresults);
+		addMenuItem(this.nextItem);
+		if (this.start &gt;= 10) {
+			addMenuItem(this.previousItem);
 		}
+		addMenuItem(MenuItem.separator(10));
+		addMenuItem(this.refreshItem);
 	}
 
+	public void refresh() {
+		UiApplication.getUiApplication().popScreen(this);
+		UiApplication.getUiApplication().pushScreen(new FriendsScreen(this.start));
+	}
 	public void updateStatus(String message) {
 		this.message = message;
 		UiApplication.getUiApplication().invokeLater(new Runnable() {
@@ -177,37 +267,105 @@ public class FriendsScreen extends MainScreen {
 			}
 		});
 	}
-
-	public void updateWhereAmI(String message) {
-		this.message = message;
-		UiApplication.getUiApplication().invokeLater(new Runnable() {
-			public void run() {
-				LabelField locationLabel = new LabelField(&quot;You're checked in @ &quot; + FriendsScreen.this.message);
-				FriendsScreen.this.setStatus(locationLabel);
-				//PlacemarkScreen.this.statusField.setText(&quot;You are currently checked in at &quot; + PlacemarkScreen.this.message);
+	
+	public void updatePendingFriends(final PendingFriends[] pendingfriends) {
+		this.pendingfriends = pendingfriends;
+		UiApplication.getUiApplication().invokeLater(new Runnable() { 
+			public void run() { 
+				if (FriendsScreen.this.pendingfriends != null) {
+					FriendsScreen.this.pendinglist.setEmptyString(&quot;Nothing to see here&quot;, DrawStyle.LEFT);
+					FriendsScreen.this.pendinglist.setSize(FriendsScreen.this.pendingfriends.length);
+					FriendsScreen.this.pendinglist.setCallback(new PendingFriendsCallback(FriendsScreen.this.pendingfriends));
+					FriendsScreen.this.pendinglist.setRowHeight((int)(ListField.ROW_HEIGHT_FONT*2));
+					LabelField pendingLabel = new LabelField(&quot;Pending Friends&quot;, LabelField.FIELD_HCENTER|LabelField.NON_FOCUSABLE);
+	                pendingLabel.setFont(FriendsScreen.this.getFont().derive(Font.BOLD, FriendsScreen.this.getFont().getHeight()+5));
+	                add(pendingLabel);
+	                add(new SeparatorField());
+					add(FriendsScreen.this.pendinglist);
+				} else {
+					RichTextField noresults = new RichTextField(&quot;You have no friends to display&quot;, 45035996273704960L);
+					add(noresults);
+				}
 			}
 		});
 	}
 
-	public void updatePlacemarks(final Placemark[] placemarks) {
-		this.placemarks = placemarks;
+	public void updateFriends(final Friends[] friends) {
+		this.friends = friends;
 		UiApplication.getUiApplication().invokeLater(new Runnable() { 
 			public void run() { 
-				FriendsScreen.this.settings.setPlacemarks(FriendsScreen.this.placemarks);
-				Settings.save(FriendsScreen.this.settings);
-				UiApplication.getUiApplication().popScreen(FriendsScreen.this.screen);
-				UiApplication.getUiApplication().pushScreen(new FriendsScreen());
+				if (FriendsScreen.this.friends != null) {
+					FriendsScreen.this.list.setEmptyString(&quot;Nothing to see here&quot;, DrawStyle.LEFT);
+					FriendsScreen.this.list.setSize(FriendsScreen.this.friends.length);
+					FriendsScreen.this.list.setCallback(new FriendsCallback(FriendsScreen.this.friends));
+					FriendsScreen.this.list.setRowHeight((int)(ListField.ROW_HEIGHT_FONT*2));
+					if (BrightBerry.getPendingFriends() &gt; 0) {
+						LabelField friendLabel = new LabelField(&quot;Friends&quot;, LabelField.FIELD_HCENTER|LabelField.NON_FOCUSABLE);
+		                friendLabel.setFont(FriendsScreen.this.getFont().derive(Font.BOLD, FriendsScreen.this.getFont().getHeight()+5));
+		                add(friendLabel);
+		                add(new SeparatorField());
+					}
+					add(FriendsScreen.this.list);
+				} else {
+					RichTextField noresults = new RichTextField(&quot;You have no friends to display&quot;, 45035996273704960L);
+					add(noresults);
+				}
 			}
 		});
 	}
 	
-	public class PlacemarkListField extends ListField {
+	public void callAccepted(final boolean accepted) {
+		UiApplication.getUiApplication().invokeLater(
+				new Runnable() {
+					public void run() {
+						if (accepted == true) {
+							Status.show(&quot;Friend Request Accepted&quot;);
+							BrightBerry.setPendingFriends(BrightBerry.getPendingFriends()-1);
+							if (UiApplication.getUiApplication().getActiveScreen() == FriendsScreen.this) {
+								FriendsScreen.this.refresh();
+							}
+						} else {
+							Status.show(&quot;Unable to accept friend request&quot;);
+						}
+					}
+				}
+			);
+	}
+	
+	public void callBlocked(final boolean blocked) {
+		UiApplication.getUiApplication().invokeLater(
+				new Runnable() {
+					public void run() {
+						if (blocked == true) {
+							Status.show(&quot;User blocked&quot;);
+							if (UiApplication.getUiApplication().getActiveScreen() == FriendsScreen.this) {
+								FriendsScreen.this.refresh();
+							}
+						} else {
+							Status.show(&quot;Unable to block user&quot;);
+						}
+					}
+				}
+			);
+	}
+	
+	public class FriendsListField extends ListField {
 		protected void makeContextMenu(ContextMenu contextMenu) {
 			contextMenu.addItem(checkinItem);
 			contextMenu.addItem(placestreamItem);
-			contextMenu.addItem(postnote);
-			contextMenu.addItem(postphoto);
+			contextMenu.addItem(userstream);
+			contextMenu.addItem(dmuser);
 			contextMenu.addItem(mapItem);
+			contextMenu.addItem(blockItem);
+		}
+	}
+	
+	public class PendingFriendsListField extends ListField {
+		protected void makeContextMenu(ContextMenu contextMenu) {
+			contextMenu.addItem(approveItem);
+			contextMenu.addItem(pendingblockItem);
+			contextMenu.addItem(pendinguserstream);
+			contextMenu.addItem(pendingdmuser);
 		}
 	}
 }</diff>
      <filename>src/mobi/bbhn/brightberry/FriendsScreen.java</filename>
    </modified>
    <modified>
      <diff>@@ -100,6 +100,8 @@ public class MainButton extends Field {
         	drawbmp = Bitmap.getBitmapResource(&quot;img/icon_mentions.gif&quot;);
         } else if (_text.endsWith(&quot;Settings&quot;)) {
         	drawbmp = Bitmap.getBitmapResource(&quot;img/icon_settings.gif&quot;);
+        } else if (_text.endsWith(&quot;Friends&quot;)) {
+        	drawbmp = Bitmap.getBitmapResource(&quot;img/icon_friends.png&quot;);
         }
         int fntnewy = (getHeight()/2)-(this.getFont().getHeight()/2);
         if (drawbmp != null) {</diff>
      <filename>src/mobi/bbhn/brightberry/MainButton.java</filename>
    </modified>
    <modified>
      <diff>@@ -29,9 +29,18 @@ OF SUCH DAMAGE.
 */
 
 
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.file.FileConnection;
+
 import net.rim.blackberry.api.invoke.CameraArguments;
 import net.rim.blackberry.api.invoke.Invoke;
+import net.rim.device.api.math.Fixed32;
+import net.rim.device.api.system.Bitmap;
 import net.rim.device.api.system.Characters;
+import net.rim.device.api.system.EncodedImage;
 import net.rim.device.api.system.EventInjector;
 import net.rim.device.api.ui.Field;
 import net.rim.device.api.ui.FieldChangeListener;
@@ -39,6 +48,7 @@ import net.rim.device.api.ui.MenuItem;
 import net.rim.device.api.ui.UiApplication;
 import net.rim.device.api.ui.component.AutoTextEditField;
 import net.rim.device.api.ui.component.BasicEditField;
+import net.rim.device.api.ui.component.BitmapField;
 import net.rim.device.api.ui.component.ButtonField;
 import net.rim.device.api.ui.component.EditField;
 import net.rim.device.api.ui.component.LabelField;
@@ -76,6 +86,7 @@ public class PostPhotoScreen extends MainScreen implements FieldChangeListener {
 	private BrightBerryJournalListener _fileListener;
 	private BrightBerry _uiApp;
 	private String filetoupload;
+	private boolean fromExplorer = false;
 	
 	protected boolean onSavePrompt() {
 		return true;
@@ -88,17 +99,33 @@ public class PostPhotoScreen extends MainScreen implements FieldChangeListener {
 		}
 	};
 	
-	// Post photo at the current checked in location
+	// Post photo at the current checked in location from the app
 	public PostPhotoScreen() {
 		_uiApp = (BrightBerry)UiApplication.getUiApplication();
-        _fileListener = new BrightBerryJournalListener(this);        
-        _uiApp.addFileSystemJournalListener(_fileListener);
-        
+    	_fileListener = new BrightBerryJournalListener(this);        
+    	_uiApp.addFileSystemJournalListener(_fileListener);
+        	
+		Thread whereThread = new WhereAmIThread(this.screen);
+		whereThread.start();
+		setTitle(new LabelField(&quot;BrightBerry Post Photo&quot;, Field.FIELD_HCENTER));
+		postBtn = new ButtonField(&quot;Post Photo&quot;, ButtonField.CONSUME_CLICK);
+		postBtn.setChangeListener(this);
+	}
+	
+	// Post a photo at the current checked in location from file explorer
+	public PostPhotoScreen(String filename) {
+		filetoupload = filename;
+	    int lastSlash = filename.lastIndexOf('/') + 1;
+        String newfilename = filename.substring(lastSlash, filename.length());
+		this.fileName.setText(newfilename);
+		this.fromExplorer = true;
+		
 		Thread whereThread = new WhereAmIThread(this.screen);
 		whereThread.start();
 		setTitle(new LabelField(&quot;BrightBerry Post Photo&quot;, Field.FIELD_HCENTER));
 		postBtn = new ButtonField(&quot;Post Photo&quot;, ButtonField.CONSUME_CLICK);
 		postBtn.setChangeListener(this);
+		
 	}
 	
 	// Post photo about a location
@@ -177,7 +204,11 @@ public class PostPhotoScreen extends MainScreen implements FieldChangeListener {
 					PostPhotoScreen.this.add(fileName);
 					PostPhotoScreen.this.add(postBtn);
 					PostPhotoScreen.this.addMenuItem(updateItem);
-					Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());
+					if (PostPhotoScreen.this.fromExplorer == false) {
+						Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments());
+					} else {
+						PostPhotoScreen.this.drawPreview(PostPhotoScreen.this.filetoupload);
+					}
 				}
 			});
 	}
@@ -190,6 +221,36 @@ public class PostPhotoScreen extends MainScreen implements FieldChangeListener {
 	    int lastSlash = filename.lastIndexOf('/') + 1;
         String newfilename = filename.substring(lastSlash, filename.length());
 		this.fileName.setText(newfilename);
+		drawPreview(filename);
 		_uiApp.removeFileSystemJournalListener(_fileListener);
 	}
+	
+	public void drawPreview(String filename) {
+		try {
+			FileConnection fconn = (FileConnection)Connector.open(&quot;file://&quot; + filename);
+			// If no exception is thrown, then the URI is valid, but the file may or may not exist.
+			if (fconn.exists()) {
+				InputStream input = fconn.openInputStream();
+				int available = (int) fconn.fileSize();
+				System.out.println(&quot;Available: &quot; + available);
+				byte[] data = new byte[available];
+				input.read(data, 0, available);
+				EncodedImage image = EncodedImage.createEncodedImage(data, 0, data.length);
+				int oldHeight = image.getHeight();
+				int Height = 150;
+				
+				int numerator = Fixed32.toFP(oldHeight);
+				int denominator = Fixed32.toFP(Height);
+				int widthScale = Fixed32.div(numerator, denominator);
+				
+				EncodedImage newEi = image.scaleImage32(widthScale, widthScale);
+				Bitmap b = newEi.getBitmap();
+				BitmapField picture = new BitmapField(b, BitmapField.FOCUSABLE|BitmapField.FIELD_HCENTER);
+				add(picture);
+			}
+			fconn.close();
+		} catch (IOException e) {
+			System.out.println(e.toString());
+		}
+	}
 }</diff>
      <filename>src/mobi/bbhn/brightberry/PostPhotoScreen.java</filename>
    </modified>
    <modified>
      <diff>@@ -90,8 +90,19 @@ public class PostPhotoThread extends Thread {
 			
 			String message1 = &quot;&quot;;
 			message1 += &quot;-----------------------------4664151417711&quot; + CrLf;
-			message1 += &quot;Content-Disposition: form-data; name=\&quot;photo[photo]\&quot;; filename=\&quot;BrightBerry-uploadedimage.jpg\&quot;&quot; + CrLf;
-			message1 += &quot;Content-Type: image/jpeg&quot; + CrLf;
+			if (filename.endsWith(&quot;.jpg&quot;) || filename.endsWith(&quot;.jpeg&quot;)) {
+				message1 += &quot;Content-Disposition: form-data; name=\&quot;photo[photo]\&quot;; filename=\&quot;BrightBerry-uploadedimage.jpg\&quot;&quot; + CrLf;
+				message1 += &quot;Content-Type: image/jpeg&quot; + CrLf;
+			} else if (filename.endsWith(&quot;.png&quot;)) {
+				message1 += &quot;Content-Disposition: form-data; name=\&quot;photo[photo]\&quot;; filename=\&quot;BrightBerry-uploadedimage.png\&quot;&quot; + CrLf;
+				message1 += &quot;Content-Type: image/x-png&quot; + CrLf;
+			} else if (filename.endsWith(&quot;.gif&quot;)) {
+				message1 += &quot;Content-Disposition: form-data; name=\&quot;photo[photo]\&quot;; filename=\&quot;BrightBerry-uploadedimage.gif\&quot;&quot; + CrLf;
+				message1 += &quot;Content-Type: image/gif&quot; + CrLf;
+			} else if (filename.endsWith(&quot;.bmp&quot;)) {
+				message1 += &quot;Content-Disposition: form-data; name=\&quot;photo[photo]\&quot;; filename=\&quot;BrightBerry-uploadedimage.bmp\&quot;&quot; + CrLf;
+				message1 += &quot;Content-Type: image/x-ms-bmp&quot; + CrLf;
+			}
 			message1 += CrLf;
 
 			String message2 = &quot;&quot;;</diff>
      <filename>src/mobi/bbhn/brightberry/PostPhotoThread.java</filename>
    </modified>
    <modified>
      <diff>@@ -33,15 +33,19 @@ import net.rim.device.api.ui.FieldChangeListener;
 import net.rim.device.api.ui.MenuItem;
 import net.rim.device.api.ui.UiApplication;
 import net.rim.device.api.ui.component.AutoTextEditField;
+import net.rim.device.api.ui.component.BasicEditField;
 import net.rim.device.api.ui.component.ButtonField;
 import net.rim.device.api.ui.component.LabelField;
+import net.rim.device.api.ui.component.RichTextField;
 import net.rim.device.api.ui.component.Status;
 import net.rim.device.api.ui.container.MainScreen;
+import net.rim.device.api.ui.container.VerticalFieldManager;
 
 public class SendDirectMessageScreen extends MainScreen implements FieldChangeListener {
 	Settings settings = Settings.getInstance();
 	SendDirectMessageScreen screen = this;
 	AutoTextEditField note = new AutoTextEditField(&quot;Message: &quot;, &quot;&quot;, 140, AutoTextEditField.SPELLCHECKABLE|AutoTextEditField.NO_NEWLINE);
+	RichTextField leftField = new RichTextField(&quot;Characters Left: 140/140&quot;, RichTextField.NON_FOCUSABLE);
 	ButtonField postBtn;
 	MenuItem updateItem;
 	private String user;
@@ -49,7 +53,13 @@ public class SendDirectMessageScreen extends MainScreen implements FieldChangeLi
 	protected boolean onSavePrompt() {
 		return true;
 	}
-
+	
+	FieldChangeListener inputListener = new FieldChangeListener() {
+		public void fieldChanged(Field field, int context) {
+			int charleft = 140-((BasicEditField) field).getTextLength();
+			leftField.setText(&quot;Characters Left: &quot; + charleft + &quot;/140&quot;);
+		}
+	};
 	
 	public SendDirectMessageScreen(String user) {
 		this.user = user;
@@ -70,8 +80,12 @@ public class SendDirectMessageScreen extends MainScreen implements FieldChangeLi
 		
 		postBtn = new ButtonField(&quot;Send Message&quot;, ButtonField.CONSUME_CLICK);
 		postBtn.setChangeListener(this);
+		note.setChangeListener(inputListener);
 		add(note);
 		add(postBtn);
+		VerticalFieldManager status = new VerticalFieldManager();
+		status.add(leftField);
+		setStatus(status);
 
 	}
 	</diff>
      <filename>src/mobi/bbhn/brightberry/SendDirectMessageScreen.java</filename>
    </modified>
    <modified>
      <diff>@@ -512,12 +512,20 @@ public class StreamScreen extends MainScreen {
 				contextMenu.addItem(new ViewPlaceItem());
 			}
 			contextMenu.addItem(new ViewMoreMenuItem());
-			contextMenu.addItem(new FullTextMenuItem());
+			if (stream[list.getSelectedIndex()].getType().equals(&quot;checkin&quot;) == false) {
+				contextMenu.addItem(new FullTextMenuItem());
+			}
 			contextMenu.addItem(new PostCommentMenuItem());
 			if (StreamScreen.this.streamtoview.equals(&quot;person&quot;) == false) {
 				contextMenu.addItem(new ViewStreamItem());
 			}
 		}
+		
+		protected boolean trackwheelClick(int status, int time) {
+			String objectID = stream[list.getSelectedIndex()].getId();
+			UiApplication.getUiApplication().pushScreen(new BkObjectScreen(objectID));
+			return true;
+		}
 	}
 	
 	public void callDelete(boolean deleted, String type, int listindex) {</diff>
      <filename>src/mobi/bbhn/brightberry/StreamScreen.java</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>src/mobi/bbhn/brightberry/OptionsScreen.java</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>004f484ffa7123186b4306554c7a9db3c78377fb</id>
    </parent>
  </parents>
  <author>
    <name>Chris Hallgren</name>
    <email>challgren@hallgrennetwork.com</email>
  </author>
  <url>http://github.com/challgren/brightberry/commit/ab94de20fd215fa4fd634c1c68f6719d791f8290</url>
  <id>ab94de20fd215fa4fd634c1c68f6719d791f8290</id>
  <committed-date>2009-07-06T17:55:06-07:00</committed-date>
  <authored-date>2009-07-06T17:55:06-07:00</authored-date>
  <message>Version 0.2.7 - See changelog</message>
  <tree>ac3ece5dded3392a6675edab88b20734056a571c</tree>
  <committer>
    <name>Chris Hallgren</name>
    <email>challgren@hallgrennetwork.com</email>
  </committer>
</commit>
