Made remote paths deconstructible
[doldaconnect.git] / clients / gnome-trans-applet / conduit-dclib.c
index 2089f7f..6ce3f82 100644 (file)
@@ -84,8 +84,7 @@ static char *gettag(struct dc_transfer *dt)
        return(NULL);
     if((mbspath = icwcstombs(dt->path, "UTF-8")) == NULL)
        return(NULL);
-    /* XXX: Achtung! Too DC-specific! */
-    if((p = strrchr(mbspath, '\\')) == NULL)
+    if((p = strrchr(mbspath, '/')) == NULL)
        p = mbspath;
     else
        p++;
@@ -142,7 +141,7 @@ static void inittrans(struct conduit *conduit, struct dc_transfer *dt)
     dtd->conduit = conduit;
     dt->udata = dtd;
     dt->destroycb = dtfreecb;
-    dc_queuecmd(lstrargcb, dt, L"lstrarg", L"%%i", dt->id, NULL);
+    dc_queuecmd(lstrargcb, dt, L"lstrarg", L"%i", dt->id, NULL);
 }
 
 static void trlistcb(int resp, struct conduit *conduit)
@@ -195,12 +194,12 @@ static void dcfdcb(struct conduit *conduit, int fd, GdkInputCondition condition)
     {
        if(!wcscmp(resp->cmdname, L".connect"))
        {
-           if(resp->code == 200)
+           if(dc_checkprotocol(resp, DC_LATEST))
            {
-               dc_loginasync(NULL, 1, noconv, (void (*)(int, wchar_t *, void *))logincb, conduit);
-           } else {
                dc_disconnect();
                disconnected(conduit);
+           } else {
+               dc_loginasync(NULL, 1, noconv, (void (*)(int, wchar_t *, void *))logincb, conduit);
            }
        } else if(!wcscmp(resp->cmdname, L".notify")) {
            dc_uimisc_handlenotify(resp);
@@ -312,7 +311,7 @@ static int cancel(struct conduit *conduit, struct transfer *transfer)
     {
        if(((dtd = dt->udata) != NULL) && (dtd->ct == transfer))
        {
-           dc_queuecmd(NULL, NULL, L"cancel", L"%%i", dt->id, NULL);
+           dc_queuecmd(NULL, NULL, L"cancel", L"%i", dt->id, NULL);
            return(0);
        }
     }