From 429f5f4192c3fef8222c48bb94f31579ee7d529e Mon Sep 17 00:00:00 2001
From: Tristan Cavelier <tristan.cavelier@tiolive.com>
Date: Fri, 21 Dec 2012 11:35:25 +0100
Subject: [PATCH] docid management modified on command.js

---
 src/jio/commands/command.js | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/jio/commands/command.js b/src/jio/commands/command.js
index 8aff3cd..52de24e 100644
--- a/src/jio/commands/command.js
+++ b/src/jio/commands/command.js
@@ -21,15 +21,7 @@ var command = function(spec, my) {
 
     priv.tried     = 0;
     priv.doc       = spec.doc || {};
-    priv.doc._id   = priv.doc._id;
-    priv.docid     = spec.docid || '';
-
-    // xxx fixed spec.content to spec.doc.content for PUTATTACHMENT
-    // xxx need extra check for GET, otherwise spec.doc is undefined
-    priv.content   = spec.doc === undefined ? undefined :
-        typeof spec.doc.content === 'string'?
-                spec.doc.content:
-                undefined;
+    priv.docid     = spec.docid || spec.doc._id || '';
     priv.option    = spec.options || {};
     priv.callbacks = spec.callbacks || {};
     priv.success   = priv.callbacks.success || function (){};
@@ -67,13 +59,10 @@ var command = function(spec, my) {
     };
 
     that.getDocId = function () {
-        return (priv.docid || priv.doc._id).split('/')[0];
+        return priv.docid.split('/')[0];
     };
     that.getAttachmentId = function () {
-        return (priv.docid || priv.doc._id).split('/')[1];
-    };
-    that.getContent = function () {
-        return priv.content;
+        return priv.docid.split('/')[1];
     };
     /**
      * @method getDoc           returns the label of the command.
-- 
2.30.9