magnet in search window details torrent info

After you have edited the source code, post your patch here.
Forum rules
Home | Wiki | Rules

magnet in search window details torrent info

Postby ivan386 » 18 Feb 2017 19:55

Code: Select all
Index: MetaList.cpp
===================================================================
--- MetaList.cpp   (revision 9650)
+++ MetaList.cpp   (working copy)
@@ -663,7 +663,15 @@
 
       return TRUE;
    }
+   else if ( m_pMember && m_pMember->m_sName == _T( "hash" ) )
+   {
+      m_bLink = TRUE;
+      m_sLink =  _T("magnet:?xt=urn:btih:") + m_sValue;
+      m_sLinkName = m_sValue;
 
+      return TRUE;
+   }
+
    if ( m_pMember == NULL ) return FALSE;
    
    if ( m_pMember->m_sLinkURI.IsEmpty() ) return FALSE;
@@ -687,7 +695,7 @@
 {
    if ( bHTTP )
    {
-      if ( m_sLink.Find( _T("http://") ) == 0 )
+      if ( m_sLink.Find( _T("http://") ) == 0 || m_sLink.Find( _T("magnet:?") ) == 0 )
       {
          ShellExecute( AfxGetMainWnd()->GetSafeHwnd(), _T("open"), m_sLink,
             NULL, NULL, SW_SHOWNORMAL );

Attachments
MetaList (magnet in search window details torrent info).zip
(6.13 KiB) Downloaded 11 times
Last edited by ivan386 on 18 Feb 2017 21:12, edited 1 time in total.
data:application/exe,%B4%09%BA%0D%01%CD%21%B4%08%CD%21%CD%20Hello,World!$
ivan386
 
Posts: 259
Joined: 17 Jun 2009 14:08

Re: magnet in search window details torrent info

Postby raspopov » 18 Feb 2017 20:21

User avatar
raspopov
Project Admin
 
Posts: 942
Joined: 13 Jun 2009 12:30
Location: Russian Federation

Re: magnet in search window details torrent info

Postby ivan386 » 18 Feb 2017 21:15

You are so fast ))
Added: "return TRUE;"
data:application/exe,%B4%09%BA%0D%01%CD%21%B4%08%CD%21%CD%20Hello,World!$
ivan386
 
Posts: 259
Joined: 17 Jun 2009 14:08

Re: magnet in search window details torrent info

Postby raspopov » 19 Feb 2017 05:57

Anyway return value is not checked nowhere.
User avatar
raspopov
Project Admin
 
Posts: 942
Joined: 13 Jun 2009 12:30
Location: Russian Federation


Return to Code Submission

Who is online

Users browsing this forum: No registered users and 1 guest