2
* $Id: fe-xmpp-queries.c,v 1.12 2007/11/26 12:55:08 errtu Exp $
2
* $Id: fe-xmpp-queries.c,v 1.15 2008/04/05 20:50:45 errtu Exp $
4
4
* Copyright (C) 2007 Colin DIDIER
6
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation.
11
10
* This program is distributed in the hope that it will be useful,
12
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
35
34
int show, const char *status)
37
36
XMPP_QUERY_REC *rec;
37
XMPP_ROSTER_USER_REC *user;
40
41
g_return_if_fail(server != NULL);
41
42
g_return_if_fail(full_jid != NULL);
48
49
msg = fe_xmpp_presence_show[show];
51
user = xmpp_rosters_find_user(server->roster, full_jid, NULL, NULL);
52
name = user != NULL && user->name != NULL ?
53
format_get_text(MODULE_NAME, NULL, server, NULL,
54
XMPPTXT_FORMAT_NAME, user->name, full_jid) :
55
format_get_text(MODULE_NAME, NULL, server, NULL,
56
XMPPTXT_FORMAT_JID, full_jid);
50
58
if (status != NULL)
51
59
printformat_module(MODULE_NAME, server, full_jid, MSGLEVEL_CRAP,
52
XMPPTXT_PRESENCE_CHANGE_REASON, full_jid, msg, status);
60
XMPPTXT_PRESENCE_CHANGE_REASON, name, msg, status);
54
62
printformat_module(MODULE_NAME, server, full_jid, MSGLEVEL_CRAP,
55
XMPPTXT_PRESENCE_CHANGE, full_jid, msg);
63
XMPPTXT_PRESENCE_CHANGE, name, msg);
78
86
if (!IS_XMPP_QUERY(query))
81
user = xmpp_rosters_find_user(query->server->roster, query->name, NULL);
89
user = xmpp_rosters_find_user(query->server->roster, query->name, NULL,
82
91
if (user == NULL || user->name == NULL)