Index: applications/editors/josm/plugins/o5m/src/org/openstreetmap/josm/plugins/o5m/io/O5mReader.java
===================================================================
--- applications/editors/josm/plugins/o5m/src/org/openstreetmap/josm/plugins/o5m/io/O5mReader.java	(revision 32856)
+++ applications/editors/josm/plugins/o5m/src/org/openstreetmap/josm/plugins/o5m/io/O5mReader.java	(revision 32857)
@@ -28,4 +28,7 @@
 import java.util.Map;
 
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.DataSource;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -50,5 +53,6 @@
 public class O5mReader extends AbstractReader {
 	public IllegalDataException exception = null;
-
+	private boolean discourageUpload;
+	
     private static void checkCoordinates(LatLon coor) throws IllegalDataException {
         if (!coor.isValid()) {
@@ -115,11 +119,8 @@
     	private int version;
 		private User osmUser;
-    	
+    	private String header; 
     	/**
     	 * A parser for the o5m format
-    	 * @param processor A mapProcessor instance
     	 * @param stream The InputStream that contains the OSM data in o5m format 
-    	 * @param skipArray An Array of longs that is used to hold information of file position of the first occurrence of 
-    	 * each known 05m data type (esp. nodes, ways, and relations). 
     	 */
     	O5mReader(InputStream stream) {
@@ -144,4 +145,6 @@
     				throw new IOException(tr("wrong header byte ") + Integer.toHexString(start));
     			readFile();
+    			if (discourageUpload)
+    				ds.setUploadDiscouraged(true);
     		} catch (IOException e) {
     			e.printStackTrace();
@@ -189,5 +192,5 @@
     			else if (fileType == WAY_DATASET) readWay();
     			else if (fileType == REL_DATASET) readRel();
-    			//else if (fileType == BBOX_DATASET) readBBox();
+    			else if (fileType == BBOX_DATASET) readBBox();
     			else if (fileType == TIMESTAMP_DATASET) readFileTimestamp();
     			else if (fileType == HEADER_DATASET) readHeader();
@@ -222,14 +225,18 @@
     	 * @throws IOException
     	 */
-		/*
     	private void readBBox() {
-    		double leftf = (double) (100L*readSignedNum32()) * FACTOR;
-    		double bottomf = (double) (100L*readSignedNum32()) * FACTOR;
-    		double rightf = (double) (100L*readSignedNum32()) * FACTOR;
-    		double topf = (double) (100L*readSignedNum32()) * FACTOR;
-    		assert bytesToRead == 0;
-    		setBBox(bottomf, leftf, topf, rightf);
-    	}
-		 */
+    		double minlon = FACTOR * 100L * readSignedNum32();
+    		double minlat = FACTOR * 100L * readSignedNum32();
+    		double maxlon = FACTOR * 100L * readSignedNum32();
+    		double maxlat = FACTOR * 100L * readSignedNum32();
+
+            Bounds b = new Bounds(minlat, minlon, maxlat, maxlon);
+            if (!b.isCollapsed() && LatLon.isValidLat(minlat) && LatLon.isValidLat(maxlat) 
+                                 && LatLon.isValidLon(minlon) && LatLon.isValidLon(maxlon)) {
+                ds.dataSources.add(new DataSource(b, header));
+            } else {
+                Main.error("Invalid Bounds: "+b);
+            }
+    	}
 
     	/**
@@ -255,4 +262,6 @@
     			assert flat >= -90.0 && flat <= 90.0;  
     			assert flon >= -180.0 && flon <= 180.0;  
+    			if (version == 0)
+    				discourageUpload = true;
     			Node node = new Node(lastNodeId, version == 0 ? 1:version);
     			node.setCoor(new LatLon(flat, flon).getRoundedToOsmPrecision());
@@ -295,4 +304,6 @@
     			if (bytesToRead == 0)
     				return; // only wayId + version: this is a delete action, we ignore it
+    			if (version == 0)
+    				discourageUpload = true;
     			final Way way = new Way(lastWayId, version == 0 ? 1:version);
     			checkChangesetId(lastChangeSet);
@@ -339,4 +350,6 @@
     			if (bytesToRead == 0)
     				return; // only relId + version: this is a delete action, we ignore it 
+    			if (version == 0)
+    				discourageUpload = true;
     			final Relation rel = new Relation(lastRelId, version == 0 ? 1:version);
     			checkChangesetId(lastChangeSet);
@@ -565,4 +578,5 @@
     			throw new IOException(tr("unsupported header"));
     		}
+    		header = new String(ioBuf, 0, 3, "UTF-8");
     	}
     	
