#include "MsgStorageHandler.h"
#include "MsgPluginManager.h"
#include "MsgTransManager.h"
+#include "MsgContact.h"
#include "MsgCmdHandler.h"
return eventSize;
}
+
+
+int MsgContactSyncEventHandler(const MSG_CMD_S *pCmd, char **ppEvent)
+{
+ msg_error_t err = MSG_SUCCESS;
+
+
+ int eventSize = 0;
+
+ MsgSyncContact();
+
+ // Make Event Data
+ eventSize = MsgMakeEvent(NULL, 0, MSG_EVNET_CONTACT_SYNC, err, (void**)ppEvent);
+
+ return eventSize;
+}
handlerMap[MSG_CMD_DELETE_PUSH_EVENT] = &MsgDeletePushEventHandler;
handlerMap[MSG_CMD_UPDATE_PUSH_EVENT] = &MsgUpdatePushEventHandler;
handlerMap[MSG_CMD_DELETE_MESSAGE_BY_LIST] = &MsgDeleteMessageByListHandler;
+
+ handlerMap[MSG_CMD_CONTACT_SYNC] = &MsgContactSyncEventHandler;
}
MSG_CMD_UPDATE_PUSH_EVENT,
MSG_CMD_DELETE_MESSAGE_BY_LIST,
MSG_CMD_SET_FILTER_ACTIVATION,
+ MSG_CMD_CONTACT_SYNC,
// end of MSG_CMD; new CMD should be defined before MSG_CMD_NUM
MSG_CMD_NUM
MSG_EVENT_UPDATE_PUSH_EVENT,
MSG_EVENT_DELETE_MESSAGE_BY_LIST,
MSG_EVENT_SET_FILTER_ACTIVATION,
+ MSG_EVNET_CONTACT_SYNC,
// end of MSG_EVENT; new EVENT should be defined before MSG_EVENT_NUM
MSG_EVENT_NUM
int MsgDeletePushEventHandler(const MSG_CMD_S *pCmd, char **ppEvent);
int MsgUpdatePushEventHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+int MsgContactSyncEventHandler(const MSG_CMD_S *pCmd, char **ppEvent);
+
#endif // MSG_CMD_HANDLER_H
Name: msg-service
-Version: 0.9.9
+Version: 0.9.10
Release: 1
License: Flora
Summary: Messaging Framework Library
}
#include "MsgDebug.h"
+#include "MsgIpcSocket.h"
#include "MsgUtilStorage.h"
#include "MsgGconfWrapper.h"
#include "MsgContact.h"
{
MSG_DEBUG("Contact Data is Changed!!!");
- MsgSyncContact();
+ // establish connection to msgfw daemon
+ MsgIpcClientSocket client;
+ client.connect(MSG_SOCKET_PATH);
- if (ContactDbHandle.disconnect() != MSG_SUCCESS)
- MSG_DEBUG("DB Disconnect Fail");
+ // composing command
+ int cmdSize = sizeof(MSG_CMD_S); // cmd type
+
+ char cmdBuf[cmdSize];
+ bzero(cmdBuf, cmdSize);
+
+ MSG_CMD_S* pCmd = (MSG_CMD_S*) cmdBuf;
+
+ // Set Command Parameters
+ pCmd->cmdType = MSG_CMD_CONTACT_SYNC;
+
+ memset(pCmd->cmdCookie, 0x00, MAX_COOKIE_LEN);
+
+ // Send Command to Transaction Manager
+ client.write(cmdBuf, cmdSize);
+
+ // Receive result from Transaction Manager
+ char *temp = NULL;
+ AutoPtr<char> wrap(&temp);
+ unsigned int len;
+ client.read(&temp, &len);
+
+ // close connection to msgfw daemon
+ client.close();
}