Added room_parse_room_jid to room_chat

This commit is contained in:
James Booth
2012-11-06 23:56:47 +00:00
parent 8beca3cbf7
commit 3436a2245d
3 changed files with 45 additions and 12 deletions

View File

@@ -90,6 +90,23 @@ room_get_nick_for_room(const char * const jid)
}
}
gboolean
room_parse_room_jid(const char * const room_jid, char **room, char **nick)
{
char **tokens = g_strsplit(room_jid, "/", 0);
if (tokens == NULL || tokens[0] == NULL || tokens[1] == NULL) {
return FALSE;
} else {
*room = strdup(tokens[0]);
*nick = strdup(tokens[1]);
g_strfreev(tokens);
return TRUE;
}
}
static void
_room_free(muc_room *room)
{