Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a spelling mistake (transfer not transfert)
- Loading branch information
Nicolas Cornu
committed
Jun 16, 2010
1 parent
b5fd8dd
commit 9edd57f
Showing
10 changed files
with
143 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_library(jingle-filetransfer MODULE filetransfer.c) | ||
set_target_properties(jingle-filetransfer PROPERTIES COMPILE_FLAGS "-Wall") | ||
include_directories(${CMAKE_SOURCE_DIR}) | ||
install(TARGETS jingle-filetransfer DESTINATION lib/mcabber) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
add_library(jingle MODULE jingle.c check.c action-handlers.c register.c) | ||
set_target_properties(jingle PROPERTIES COMPILE_FLAGS "-Wall") | ||
add_library(jingle MODULE jingle.c check.c action-handlers.c register.c sessions.c) | ||
set_target_properties(jingle PROPERTIES COMPILE_FLAGS "") | ||
include_directories(${LM_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) | ||
target_link_libraries(jingle ${LM_LIBRARIES}) | ||
install(TARGETS jingle DESTINATION lib/mcabber) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* sessions.c | ||
* | ||
* Copyrigth (C) 2010 Nicolas Cornu <nicolas.cornu@ensi-bourges.fr> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
* USA | ||
*/ | ||
|
||
#include <glib.h> | ||
|
||
|
||
#include <jingle/jingle.h> | ||
#include <jingle/sessions.h> | ||
|
||
|
||
static GSList *sessions; | ||
|
||
|
||
/** | ||
* Create a new session and insert it in the linked list. | ||
*/ | ||
JingleSession *session_new(JingleNode *jn) | ||
{ | ||
JingleSession *js = g_new0(JingleSession, 1); | ||
js->sid = g_strdup(jn->sid); | ||
js->initiator = g_strdup(jn->initiator); | ||
js->from = lm_message_node_get_attribute(lm_message_get_node(jn->message), | ||
"from"); | ||
if (!js->from) { | ||
return NULL; | ||
} | ||
js->from = g_strdup(js->from); | ||
|
||
|
||
sessions = g_slist_append(sessions, js); | ||
} | ||
|
||
JingleSession *session_find(const gchar *sid, const gchar *from) | ||
{ | ||
GSList *el; | ||
JingleSession *js; | ||
for (el = sessions; el; el = el->next) { | ||
js = (JingleSession*) el->data; | ||
if (g_strcmp0(js->sid, sid) && g_strcmp0(js->from, from)) { | ||
return js; | ||
} | ||
} | ||
return NULL; | ||
} | ||
|
||
/** | ||
* Remove a session from the linked list and free it. | ||
*/ | ||
void session_delete(JingleSession *sess) | ||
{ | ||
session_remove(sess); | ||
session_free(sess); | ||
} | ||
|
||
/** | ||
* Remove a session from the linked list. | ||
*/ | ||
void session_remove(JingleSession *sess) | ||
{ | ||
sessions = g_slist_remove(sessions, sess); | ||
} | ||
|
||
/** | ||
* Free a session. | ||
*/ | ||
void session_free(JingleSession *sess) | ||
{ | ||
g_free(sess->sid); | ||
g_free(sess->from); | ||
g_free(sess); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef __JINGLE_SESSIONS_H__ | ||
#define __JINGLE_SESSIONS_H__ 1 | ||
|
||
#include <glib.h> | ||
|
||
|
||
typedef enum { | ||
JINGLE_SESSION_ | ||
} JingleStatus; | ||
|
||
typedef struct { | ||
JingleStatus status; | ||
const gchar *sid; | ||
const gchar *from; | ||
GSList *content; | ||
} JingleSession; | ||
|
||
|
||
JingleSession *session_new(JingleNode *jn, | ||
gconstpointer *app, | ||
gconstpointer *transport); | ||
JingleSession *session_find(); | ||
void session_delete(JingleSession *sess); | ||
void session_remove(JingleSession *sess); | ||
void session_free(JingleSession *sess); | ||
|
||
#endif |