From 7e52b3af1d3d8138c7f9c29b482a2eda13beb3d9 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Sat, 27 Jul 2013 10:49:09 +0000 Subject: - IMO doesn't work with Skype anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@5500 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../IMO2sProxy/src/imo2skype/msgqueue.c | 158 --------------------- 1 file changed, 158 deletions(-) delete mode 100644 plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.c (limited to 'plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.c') diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.c deleted file mode 100644 index 7f1db504e9..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.c +++ /dev/null @@ -1,158 +0,0 @@ -/* Module: msgqueue.c - Purpose: Message queue for incoming messages - Author: leecher - Date: 30.08.2009 - - Fixme: Sort on insert, do a binary search instead of iterating list. -*/ - -#include -#include -#include -#include "msgqueue.h" -#include "buddylist.h" - -static volatile unsigned int m_uMsgNr=0; -static void FreeEntry(void *pEntry); - -// ----------------------------------------------------------------------------- -// Interface -// ----------------------------------------------------------------------------- - -TYP_LIST *MsgQueue_Init(void) -{ - TYP_LIST *hList = List_Init(16); - - return hList; -} - -// ----------------------------------------------------------------------------- - -void MsgQueue_Exit(TYP_LIST *hList) -{ - Queue_Exit(hList, FreeEntry); -} - -// ----------------------------------------------------------------------------- - -MSGENTRY *MsgQueue_Insert(TYP_LIST *hList, cJSON *pNick) -{ - MSGENTRY *pEntry; - cJSON *pVal; - - if (!(pEntry = Queue_InsertEntry(hList, sizeof(MSGENTRY), ++m_uMsgNr, - FreeEntry))) return NULL; - pEntry->pszUser = strdup(cJSON_GetObjectItem(pNick, "buid")->valuestring); - pEntry->pszAlias = strdup(cJSON_GetObjectItem(pNick, "alias")->valuestring); - pEntry->pszMessage = strdup(cJSON_GetObjectItem(pNick, "msg")->valuestring); - pEntry->timestamp = cJSON_GetObjectItem(pNick, "timestamp")->valueint; - if (pVal = cJSON_GetObjectItem(pNick, "author")) pEntry->pszAuthor=strdup(pVal->valuestring); - strcpy (pEntry->szStatus, "RECEIVED"); - strcpy (pEntry->szType, "TEXT"); - // imo.im somehow sets group topic via recv_im?? - if (strcmp(pEntry->pszAlias, pEntry->pszMessage) == 0) strcpy (pEntry->szType, "SETTOPIC"); - return pEntry; -} - -// ----------------------------------------------------------------------------- - -MSGENTRY *MsgQueue_AddReflect(TYP_LIST *hList, cJSON *pNick, TYP_LIST *hBuddyList) -{ - MSGENTRY *pEntry; - cJSON *pVal; - - if (!(pEntry = Queue_InsertEntry(hList, sizeof(MSGENTRY), ++m_uMsgNr, - FreeEntry))) return NULL; - pEntry->pszUser = strdup(cJSON_GetObjectItem(pNick, "buid")->valuestring); - - // Usually no alias in Reflection, so query buddy list, if available - if (pVal = cJSON_GetObjectItem(pNick, "alias")) - pEntry->pszAlias = strdup(pVal->valuestring); - else - { - NICKENTRY *pBuddy = hBuddyList?BuddyList_Find (hBuddyList, pEntry->pszUser):NULL; - pEntry->pszAlias = strdup (pBuddy?pBuddy->pszAlias:pEntry->pszUser); - } - - pEntry->pszMessage = strdup(cJSON_GetObjectItem(pNick, "msg")->valuestring); - pEntry->timestamp = cJSON_GetObjectItem(pNick, "timestamp")->valueint; - strcpy (pEntry->szStatus, "SENT"); - return pEntry; -} - -// ----------------------------------------------------------------------------- - -MSGENTRY *MsgQueue_AddSent(TYP_LIST *hList, char *pszUser, char *pszAlias, char *pszMessage, unsigned int *puMsgId) -{ - MSGENTRY *pEntry; - - if (!(pEntry = Queue_InsertEntry(hList, sizeof(MSGENTRY), ++m_uMsgNr, - FreeEntry))) return NULL; - pEntry->pszUser = strdup(pszUser); - pEntry->pszAlias = strdup(pszAlias); - pEntry->pszMessage = strdup(pszMessage); - time (&pEntry->timestamp); - strcpy (pEntry->szStatus, "SENDING"); - if (puMsgId) *puMsgId = pEntry->hdr.uMsgNr; - return pEntry; -} - -// ----------------------------------------------------------------------------- - -MSGENTRY *MsgQueue_AddEvent(TYP_LIST *hList, char *pszUser, char *pszType) -{ - MSGENTRY *pEntry; - - if (!(pEntry = Queue_InsertEntry(hList, sizeof(MSGENTRY), ++m_uMsgNr, - FreeEntry))) return NULL; - pEntry->pszUser = strdup(pszUser); - time (&pEntry->timestamp); - strcpy (pEntry->szStatus, "RECEIVED"); - strcpy (pEntry->szType, pszType); - return pEntry; -} - -// ----------------------------------------------------------------------------- - -BOOL MsgQueue_Remove(TYP_LIST *hList, unsigned int uMsgNr) -{ - return Queue_Remove(hList, uMsgNr, FreeEntry); -} - -// ----------------------------------------------------------------------------- - -MSGENTRY *MsgQueue_Find(TYP_LIST *hList, unsigned int uMsgNr) -{ - return (MSGENTRY*)Queue_Find(hList, uMsgNr); -} - -// ----------------------------------------------------------------------------- - -MSGENTRY *MsgQueue_FindByRqId(TYP_LIST *hList, unsigned int uRqId) -{ - unsigned int i; - MSGENTRY *pEntry; - - for (i=List_Count(hList)-1; (int)i!=-1; i--) - { - pEntry = (MSGENTRY*)List_ElementAt (hList, i); - if (pEntry->uRqId == uRqId) - return pEntry; - } - return NULL; -} - -// ----------------------------------------------------------------------------- -// Static -// ----------------------------------------------------------------------------- - -static void FreeEntry(void *pPEntry) -{ - MSGENTRY *pEntry = (MSGENTRY*)pPEntry; - - if (pEntry->pszAlias) free (pEntry->pszAlias); - free (pEntry->pszUser); - if (pEntry->pszMessage) free (pEntry->pszMessage); - if (pEntry->pszAuthor) free (pEntry->pszAuthor); -} - -- cgit v1.2.3