core cleanup: separate code for sipe_backend_account_status_and_note()
[siplcs.git] / src / core / sipe-buddy.h
blobfedc7294ce77025249f8b7e9c075f764ac7e106b
1 /**
2 * @file sipe-buddy.h
4 * pidgin-sipe
6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
24 struct sipe_core_private;
25 struct sipe_cal_working_hours;
27 struct sipe_buddy {
28 gchar *name;
29 gchar *activity;
30 gchar *meeting_subject;
31 gchar *meeting_location;
32 /* Sipe internal format for Note is HTML.
33 * All incoming plain text should be html-escaped
34 * for example by g_markup_escape_text()
36 gchar *note;
37 gboolean is_oof_note;
38 time_t note_since;
40 /* Calendar related fields */
41 gchar *cal_start_time;
42 int cal_granularity;
43 gchar *cal_free_busy_base64;
44 gchar *cal_free_busy;
45 time_t cal_free_busy_published;
46 /* for 2005 systems */
47 int user_avail;
48 time_t user_avail_since;
49 time_t activity_since;
50 const char *last_non_cal_status_id;
51 gchar *last_non_cal_activity;
53 struct sipe_cal_working_hours *cal_working_hours;
55 gchar *device_name;
56 GSList *groups;
57 /** flag to control sending 'context' element in 2007 subscriptions */
58 gboolean just_added;
61 /**
62 * Free all buddy information
64 * @param sipe_private SIPE core data
66 void sipe_buddy_free_all(struct sipe_core_private *sipe_private);
68 /**
69 * Tries to retrieve a real user's name associated with given SIP URI.
71 * Result must be g_free'd after use.
73 * @param sipe_private SIPE core data
74 * @param with a SIP URI
76 * @return Name of the user if the URI is found in buddy list, otherwise @c NULL
78 gchar *sipe_buddy_get_alias(struct sipe_core_private *sipe_private,
79 const gchar *with);
81 /**
82 * Update the value of a buddy property with given SIP URI
84 * @param sipe_private SIPE core data
85 * @param uri a SIP URI
86 * @param propkey property id (see sipe-backend.h)
87 * @param property_value new value for the property
89 void sipe_buddy_update_property(struct sipe_core_private *sipe_private,
90 const gchar *uri,
91 sipe_buddy_info_fields propkey,
92 gchar *property_value);