Some variables like %[filename] are missing

Bug #271565 reported by Francisco Blas Izquierdo Riera (klondike) on 2008-09-18
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LinuxDC++
Wishlist
Windkracht8

Bug Description

Some variables like %[filename] are missed when creating specified user commands.

I don't think adding them it's hard but my knowledge on the source code isn't enough to do it :(

Related branches

Changed in linuxdcpp:
importance: Undecided → Wishlist
status: New → Confirmed
Windkracht8 (windkracht8) wrote :

Could you name all the variables? or give a link to where they are all explained?

Well there are various webs on the matter like:
http://ascendentnetwork.com/print.php?type=guide&c=1&id=3
http://board.ptokax.ch/index.php?topic=7596.0

The only thing I found on the official DC++ has been:
http://www.ynhub.org/forum/showthread.php?t=3246

Those commands are really useful for server admins, and are the main reason I still stick to windows DC++ with wine.

Windkracht8 (windkracht8) wrote :

http://pastebin.es/21484
This patch adds the following variables
From search result:
-fileFN (filename)
-fileSI (filesize, in bytes)
-fileSIshort (filesize, formated)
-fileTR (TTH)
From transfer view:
-fileFN (filename)
-fileSI (filesize, in bytes)
-fileSIshort (filesize, formated)

File list view still needs to be added.

Windkracht8 (windkracht8) wrote :

http://pastebin.es/21485
With sharebrowser

Windkracht8 (windkracht8) wrote :

http://pastebin.es/21490
Changed file to UCparam.

Changed in linuxdcpp:
assignee: nobody → bartv-windkracht8
status: Confirmed → In Progress
Windkracht8 (windkracht8) wrote :

http://pastebin.es/21501
Patched against trunk version 297.
And that was the last patch. (hopefully)

Windkracht8 (windkracht8) wrote :
lys (lys) wrote :

doesnt work :

loz@UniMatrix0 ~/linuxdcpp $ patch -p0 < filedata.patch
patching file linux/UserCommandMenu.cc
Hunk #1 succeeded at 48 (offset 2 lines).
Hunk #2 FAILED at 157.
1 out of 2 hunks FAILED -- saving rejects to file linux/UserCommandMenu.cc.rej
patching file linux/UserCommandMenu.hh
Hunk #1 succeeded at 37 with fuzz 2.
Hunk #2 FAILED at 55.
1 out of 2 hunks FAILED -- saving rejects to file linux/UserCommandMenu.hh.rej
patching file linux/mainwindow.cc
Hunk #1 FAILED at 788.
1 out of 1 hunk FAILED -- saving rejects to file linux/mainwindow.cc.rej
patching file linux/search.cc
Hunk #1 succeeded at 326 (offset -7 lines).
patching file linux/sharebrowser.cc
Hunk #1 succeeded at 470 (offset 1 line).

Windkracht8 (windkracht8) wrote :
lys (lys) wrote :

works fine now :)

[21:09:11 @ 21/03/09] <-ЀÑT-BOT-> [command] !tban adriannvc 720 Sharing Rape, Preteen, Snuff, Faces Of Death, Sick Porn! ---> Xxx R@ygold incest Ass fucked preteen Girls 10yo PORN sex.MPG.bat
[21:09:11 @ 21/03/09] <-ЀÑT-BOT-> adriannvc was banned for 720 hours from the hub
 that's wicked thanks :)

lys (lys) wrote :

works fine now :)

[21:09:11 @ 21/03/09] <-ЀÑT-BOT-> [command] !tban adriannvc 720 Sharing Rape, Preteen, Snuff, Faces Of Death, Sick Porn! ---> Xxx R@ygold incest Ass fucked preteen Girls 10yo PORN sex.MPG
[21:09:11 @ 21/03/09] <-ЀÑT-BOT-> adriannvc was banned for 720 hours from the hub
 that's wicked thanks :)

lys (lys) wrote :

sorry browser timed out had & refresh

Steven Sheehy (steven-sheehy) wrote :

Thanks for the patch, it's good to have you back :). A few things:

- UCparam should be UCParam and UCParams should be ucParams.
- Please make filesize an int64_t, no need to store it as a string since it will have to be converted to an int64_t for formatting later anyway.
- Please implement "type" variable as well. You can do it dynamically based upon filename having PATH_SEPARATOR.
- Populate the params differently depending on whether it's a file or a directory (see DirectoryListingFrame::runUserCommand)
- What about user commands in directory view of sharebrowser?

Windkracht8 (windkracht8) wrote :

Good to be back. For as long as I've got time again.
No problem adding those stuff.
I didn't add this to the directory view of sharebrowser because I didn't know this should work for directories. Let me find out if this is supposed to work for directories. If so, then I'll add the type and directory view of sharebrowser. Otherwise I've got to find out what to do with directories in the searchresult.

Thanks :)

I'll try it out when I end mounting the new Hub :)

Windkracht8 (windkracht8) wrote :
Windkracht8 (windkracht8) wrote :

fixed those few things and also renamed folder in sharebrowser to directory

lys (lys) wrote :

has / will this patch be applied to trunk or will it have to be set in gentoo ebuilds to patch the src please?

lys (lys) wrote :

nevermind updated ebuild with patch submitted to gentoo bugzilla in meantime till is implimented in src

lys (lys) wrote :
Razzloss (razzloss) wrote :

Attempting to patch linuxdcpp-9999 will only break the ebuild, when the bzr repo is updated.

And yes this will be applied to the trunk. When it is finished (don't know if there will be any updates to this one. It's up to Steven/Windkracht8).

--RZ

lys (lys) wrote :

ok thanks for the info :) wasn't sure if it was to be included in the source or not and as for the gentoo ebuild gentoo works fine here till the next bzr update i guess, only replied as i noticed your post on bugzilla, while looking at the 9999 ebuild

Changed in linuxdcpp:
milestone: none → 1.1.0
status: In Progress → Fix Committed
Changed in linuxdcpp:
status: Fix Committed → Fix Released
tags: added: ui user-commands
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments