Some variables like %[filename] are missing

Bug #271565 reported by Francisco Blas Izquierdo Riera (klondike)
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LinuxDC++
Fix Released
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
Revision history for this message
Windkracht8 (windkracht8) wrote :

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

Revision history for this message
Francisco Blas Izquierdo Riera (klondike) (klondike) wrote :

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.

Revision history for this message
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.

Revision history for this message
Windkracht8 (windkracht8) wrote :

http://pastebin.es/21485
With sharebrowser

Revision history for this message
Windkracht8 (windkracht8) wrote :

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

Changed in linuxdcpp:
assignee: nobody → bartv-windkracht8
status: Confirmed → In Progress
Revision history for this message
Windkracht8 (windkracht8) wrote :

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

Revision history for this message
Windkracht8 (windkracht8) wrote :
Revision history for this message
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).

Revision history for this message
Windkracht8 (windkracht8) wrote :
Revision history for this message
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 :)

Revision history for this message
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 :)

Revision history for this message
lys (lys) wrote :

sorry browser timed out had & refresh

Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
Francisco Blas Izquierdo Riera (klondike) (klondike) wrote :

Thanks :)

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

Revision history for this message
Windkracht8 (windkracht8) wrote :
Revision history for this message
Windkracht8 (windkracht8) wrote :

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

Revision history for this message
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?

Revision history for this message
lys (lys) wrote :

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

Revision history for this message
lys (lys) wrote :
Revision history for this message
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

Revision history for this message
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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.