Commit 6faf4a4c authored by DanmeiChen's avatar DanmeiChen
Browse files

remove useless isUsingUserDefaults and fix wrapper linphone_core_get_global_state

parent b84fc7b5
......@@ -35,7 +35,7 @@
extern "C" {
#endif
LINPHONE_PUBLIC LinphonePushNotificationMessage *linphone_push_notification_message_new(bool_t is_using_user_defaults, const char *call_id, bool_t is_text,
LINPHONE_PUBLIC LinphonePushNotificationMessage *linphone_push_notification_message_new(const char *call_id, bool_t is_text,
const char *text_content, const char *subject, const char *from_addr,
const char *local_addr, const char *peer_addr);
......@@ -52,13 +52,6 @@ LINPHONE_PUBLIC LinphonePushNotificationMessage *linphone_push_notification_mess
*/
LINPHONE_PUBLIC void linphone_push_notification_message_unref(LinphonePushNotificationMessage *message);
/**
* is #LinphonePushNotificationMessage build from UserDefaults data or from a #LinphoneChatMessage
* @param message The #LinphonePushNotificationMessage object @notnil
* @return The is_using_user_defaults.
*/
LINPHONE_PUBLIC bool_t linphone_push_notification_message_is_using_user_defaults(const LinphonePushNotificationMessage *message);
/**
* Gets the call id.
* @param message The #LinphonePushNotificationMessage object @notnil
......@@ -116,4 +109,4 @@ LINPHONE_PUBLIC const LinphoneAddress *linphone_push_notification_message_get_pe
}
#endif
#endif /* LINPHONE_PUSH_NOTIFICATION_MESSAGE_H */
\ No newline at end of file
#endif /* LINPHONE_PUSH_NOTIFICATION_MESSAGE_H */
......@@ -3743,6 +3743,12 @@ LINPHONE_PUBLIC const bctbx_list_t *linphone_core_get_calls(LinphoneCore *core);
**/
LINPHONE_PUBLIC LinphoneCall *linphone_core_get_call_by_callid(const LinphoneCore *core, const char *call_id);
/**
* Returns the global state of core.
* @param core #LinphoneCore object @notnil
* @return a #LinphoneGlobalState enum. @notnil
* @ingroup misc
**/
LINPHONE_PUBLIC LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *core);
/**
......
......@@ -23,13 +23,12 @@
using namespace LinphonePrivate;
LinphonePushNotificationMessage *linphone_push_notification_message_new(bool_t is_using_user_defaults,
const char *call_id, bool_t is_text,
LinphonePushNotificationMessage *linphone_push_notification_message_new(const char *call_id, bool_t is_text,
const char *text_content, const char *subject,
const char *from_addr, const char *local_addr,
const char *peer_addr) {
return PushNotificationMessage::createCObject(
is_using_user_defaults, call_id ? call_id : "", is_text, text_content ? text_content : "",
call_id ? call_id : "", is_text, text_content ? text_content : "",
subject ? subject : "", from_addr ? from_addr : "", local_addr ? local_addr : "", peer_addr ? peer_addr : "");
}
......@@ -47,10 +46,6 @@ void linphone_push_notification_message_unref(LinphonePushNotificationMessage *m
}
}
bool_t linphone_push_notification_message_is_using_user_defaults(const LinphonePushNotificationMessage *msg) {
return PushNotificationMessage::toCpp(msg)->isUsingUserDefaults();
}
const char *linphone_push_notification_message_get_call_id(const LinphonePushNotificationMessage *msg) {
const char *call_id = PushNotificationMessage::toCpp(msg)->getCallId().c_str();
return strlen(call_id) != 0 ? call_id : NULL;
......
......@@ -397,7 +397,7 @@ shared_ptr<PushNotificationMessage> IosSharedCoreHelpers::fetchUserDefaultsMsg(c
[defaults setObject:messages forKey:@"messages"];
[defaults release];
shared_ptr<PushNotificationMessage> msg = PushNotificationMessage::create(true, callId, isText, textContent, subject, fromAddr, localAddr, peerAddr);
shared_ptr<PushNotificationMessage> msg = PushNotificationMessage::create(callId, isText, textContent, subject, fromAddr, localAddr, peerAddr);
lInfo() << "[push] PushNotificationMessage created: " << msg->toString();
return msg;
}
......
......@@ -23,19 +23,18 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
PushNotificationMessage::PushNotificationMessage(bool isUsingUserDefaults, const std::string &callId, bool isText,
PushNotificationMessage::PushNotificationMessage(const std::string &callId, bool isText,
const std::string &textContent, const std::string &subject,
const std::string &fromAddr, const std::string &localAddr,
const std::string &peerAddr) {
PushNotificationMessage::init(isUsingUserDefaults, callId, isText, textContent, subject, fromAddr, localAddr,
PushNotificationMessage::init(callId, isText, textContent, subject, fromAddr, localAddr,
peerAddr);
}
void PushNotificationMessage::init(bool isUsingUserDefaults, const std::string &callId, bool isText,
void PushNotificationMessage::init(const std::string &callId, bool isText,
const std::string &textContent, const std::string &subject,
const std::string &fromAddr, const std::string &localAddr,
const std::string &peerAddr) {
mIsUsingUserDefaults = isUsingUserDefaults;
mCallId = callId;
mIsText = isText;
mTextContent = textContent;
......@@ -45,10 +44,6 @@ void PushNotificationMessage::init(bool isUsingUserDefaults, const std::string &
mPeerAddr = peerAddr;
}
bool PushNotificationMessage::isUsingUserDefaults() const {
return mIsUsingUserDefaults;
}
const std::string &PushNotificationMessage::getCallId() const {
return mCallId;
}
......
......@@ -27,15 +27,14 @@ LINPHONE_BEGIN_NAMESPACE
class PushNotificationMessage : public bellesip::HybridObject<LinphonePushNotificationMessage, PushNotificationMessage> {
public:
PushNotificationMessage(bool isUsingUserDefaults, const std::string &callId, bool isText,
PushNotificationMessage(const std::string &callId, bool isText,
const std::string &textContent, const std::string &subject, const std::string &fromAddr,
const std::string &localAddr, const std::string &peerAddr);
void init(bool isUsingUserDefaults, const std::string &callId, bool isText, const std::string &textContent,
void init(const std::string &callId, bool isText, const std::string &textContent,
const std::string &subject, const std::string &fromAddr, const std::string &localAddr,
const std::string &peerAddr);
bool isUsingUserDefaults() const;
const std::string &getCallId() const;
bool isText() const;
const std::string &getTextContent() const;
......@@ -47,7 +46,6 @@ class PushNotificationMessage : public bellesip::HybridObject<LinphonePushNotifi
std::string toString() const override;
private:
bool mIsUsingUserDefaults;
std::string mCallId;
bool mIsText;
std::string mTextContent;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment