diff --git a/sharing/text_attachment.cc b/sharing/text_attachment.cc index d67a4fa0..00838289 100644 --- a/sharing/text_attachment.cc +++ b/sharing/text_attachment.cc @@ -137,6 +137,16 @@ TextAttachment::TextAttachment(int64_t id, Type type, std::string text_title, type_(type), text_title_(std::move(text_title)) {} +TextAttachment::TextAttachment(int64_t id, Type type, std::string text_body, + std::string text_title, int64_t size, + std::string mime_type, int32_t batch_id, + SourceType source_type) + : Attachment(id, Attachment::Family::kText, size, batch_id, source_type), + type_(type), + text_title_(std::move(text_title)), + text_body_(std::move(text_body)), + mime_type_(std::move(mime_type)) {} + void TextAttachment::MoveToShareTarget(ShareTarget& share_target) { share_target.text_attachments.push_back(std::move(*this)); } diff --git a/sharing/text_attachment.h b/sharing/text_attachment.h index a9f6442a..5669c8f1 100644 --- a/sharing/text_attachment.h +++ b/sharing/text_attachment.h @@ -42,6 +42,9 @@ class TextAttachment : public Attachment { TextAttachment(int64_t id, Type type, std::string text_title, int64_t size, int32_t batch_id = 0, SourceType source_type = SourceType::kUnknown); + TextAttachment(int64_t id, Type type, std::string text_body, + std::string text_title, int64_t size, std::string mime_type, + int32_t batch_id, SourceType source_type); TextAttachment(const TextAttachment&) = default; TextAttachment(TextAttachment&&) = default; TextAttachment& operator=(const TextAttachment&) = default; @@ -60,14 +63,12 @@ class TextAttachment : public Attachment { void set_text_body(std::string text_body); std::string mime_type() const { return mime_type_; } - SourceType source_type() const { return source_type_; } private: Type type_ = service::proto::TextMetadata::UNKNOWN; std::string text_title_; std::string text_body_; std::string mime_type_; - SourceType source_type_ = SourceType::kUnknown; }; } // namespace sharing diff --git a/sharing/wifi_credentials_attachment.h b/sharing/wifi_credentials_attachment.h index 88b836f1..a8c1efbf 100644 --- a/sharing/wifi_credentials_attachment.h +++ b/sharing/wifi_credentials_attachment.h @@ -55,7 +55,6 @@ class WifiCredentialsAttachment : public Attachment { SecurityType security_type() const { return security_type_; } absl::string_view password() const { return password_; } bool is_hidden() const { return is_hidden_; } - SourceType source_type() const { return source_type_; } // Attachment: void MoveToShareTarget(ShareTarget& share_target) override; @@ -70,7 +69,6 @@ class WifiCredentialsAttachment : public Attachment { SecurityType security_type_; std::string password_; bool is_hidden_; - SourceType source_type_; }; } // namespace sharing