Skip to content

Commit

Permalink
fix: spacing in functions and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
harrrson authored Jan 25, 2024
1 parent 7935e2f commit e9522ab
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/dpp/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,34 +884,34 @@ bool attachment::is_remix() const {

time_t attachment::get_expire_time() const {
size_t attr_position = url.find('?');
/*If no attributes were sent in url, we do not need to parse more*/
/* If no attributes were sent in url, we do not need to parse more */
if(url.npos == attr_position){
return 0;
}
std::string attributes = url.substr(attr_position+1);
std::vector<std::string> attr_list = utility::tokenize(attributes,"&");
auto ex_attr = std::find_if(attr_list.begin(), attr_list.end(),[](const std::string& s){return s.substr(0,3) == "ex=";});
std::string attributes = url.substr(attr_position + 1);
std::vector<std::string> attr_list = utility::tokenize(attributes, "&");
auto ex_attr = std::find_if(attr_list.begin(), attr_list.end(), [](const std::string& s){return s.substr(0, 3) == "ex=";});
if(attr_list.end() == ex_attr){
return 0;
}
/*Erase 'ex=' prefix before parsing*/
return std::stol(ex_attr->substr(3),nullptr,16);
/* Erase 'ex=' prefix before parsing */
return std::stol(ex_attr->substr(3), nullptr, 16);
}

time_t attachment::get_issued_time() const {
size_t attr_position = url.find('?');
/*No attributes were sent in url, so we do not need to parse more*/
/* No attributes were sent in url, so we do not need to parse more */
if(url.npos == attr_position){
return 0;
}
std::string attributes = url.substr(attr_position+1);
std::vector<std::string> attr_list = utility::tokenize(attributes,"&");
auto is_attr = std::find_if(attr_list.begin(), attr_list.end(),[](const std::string& s){return s.substr(0,3) == "is=";});
std::string attributes = url.substr(attr_position + 1);
std::vector<std::string> attr_list = utility::tokenize(attributes, "&");
auto is_attr = std::find_if(attr_list.begin(), attr_list.end(), [](const std::string& s){return s.substr(0, 3) == "is=";});
if(attr_list.end() == is_attr){
return 0;
}
/*Erase 'is=' prefix before parsing*/
return std::stol(is_attr->substr(3),nullptr,16);
/* Erase 'is=' prefix before parsing */
return std::stol(is_attr->substr(3), nullptr, 16);
}

json message::to_json(bool with_id, bool is_interaction_response) const {
Expand Down

0 comments on commit e9522ab

Please sign in to comment.