diff --git a/src/Mimetypes.cpp b/src/Mimetypes.cpp index 576568a..5e03014 100644 --- a/src/Mimetypes.cpp +++ b/src/Mimetypes.cpp @@ -1,4 +1,4 @@ -// borrowed significantly from mailserver. thanks! <3 +// borrowed significantly (addAttribute) from mailserver. thanks! <3 #include #include #include @@ -6,6 +6,7 @@ #include #include "Mimetypes.h" +// install the Feed Entry mimetype, if need be bool feedMimeType ( ) { @@ -25,12 +26,12 @@ feedMimeType ( ) addAttribute( info, "FEED:source", "Source" ); addAttribute( info, "FEED:when", "When", B_TIME_TYPE, 150 ); - mime.SetAttrInfo( &info ); - return true; + return mime.SetAttrInfo( &info ); } // ------------------------------------- +// add the given attribute to a BMessage for use as attr info static void addAttribute ( BMessage& msg, const char* name, const char* publicName, int32 type, int32 width ) diff --git a/src/Util.cpp b/src/Util.cpp index 99b3c6e..fbc5849 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -73,6 +73,19 @@ withinDateRange ( BDateTime minDate, BDateTime nowDate, BDateTime maxDate ) // ---------------------------------------------------------------------------- +// return whether or not the given path is remote +bool +isRemotePath ( BString path ) { + BUrl givenUrl = BUrl( path ); + BString protocol = givenUrl.Protocol().String(); + + if ( protocol == NULL || protocol == BString("file") || givenUrl.UrlString() == NULL ) + return false; + return true; +} + +// ---------------------------------------------------------------------------- + int32 webFetch ( BUrl url, BDataIO* reply ) { diff --git a/src/Util.h b/src/Util.h index a838c79..6afac85 100644 --- a/src/Util.h +++ b/src/Util.h @@ -14,6 +14,8 @@ BString dateTo3339String ( BDateTime ); bool withinDateRange ( BDateTime, BDateTime, BDateTime ); +bool isRemotePath ( BString ); + int32 webFetch ( BUrl, BDataIO*, BString* ); int32 webFetch ( BUrl, BDataIO* );