i18n: update bug tracker URL in script
[siplcs.git] / src / core / sipe-buddy.h
blob94a733d0884a1282f25053425c7245c2ac31768e
1 /**
2 * @file sipe-buddy.h
4 * pidgin-sipe
6 * Copyright (C) 2010-12 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 * Creates @c sipe_buddy structure for a new buddy and adds it into the buddy
63 * list of given account. If buddy is already in the list, its existing
64 * structure is returned.
66 * @param sipe_private SIPE core data
67 * @param uri SIP URI of a buddy
69 * @return @c sipe_buddy structure
71 struct sipe_buddy *sipe_buddy_add(struct sipe_core_private *sipe_private,
72 const gchar *uri);
74 /**
75 * Cancels buddy subscriptions and then deletes the buddy
77 * @param sipe_private SIPE core data
78 * @param buddy @c sipe_buddy structure to remove
80 void sipe_buddy_remove(struct sipe_core_private *sipe_private,
81 struct sipe_buddy *buddy);
83 /**
84 * Free all buddy information
86 * @param sipe_private SIPE core data
88 void sipe_buddy_free_all(struct sipe_core_private *sipe_private);
90 /**
91 * Tries to retrieve a real user's name associated with given SIP URI.
93 * Result must be g_free'd after use.
95 * @param sipe_private SIPE core data
96 * @param with a SIP URI
98 * @return Name of the user if the URI is found in buddy list, otherwise @c NULL
100 gchar *sipe_buddy_get_alias(struct sipe_core_private *sipe_private,
101 const gchar *with);
104 * Update the value of a buddy property with given SIP URI
106 * @param sipe_private SIPE core data
107 * @param uri a SIP URI
108 * @param propkey property id (see sipe-backend.h)
109 * @param property_value new value for the property
111 void sipe_buddy_update_property(struct sipe_core_private *sipe_private,
112 const gchar *uri,
113 sipe_buddy_info_fields propkey,
114 gchar *property_value);
117 * Triggers a download of all buddy photos that were changed on the server.
119 * @param sipe_private SIPE core data
121 void sipe_buddy_refresh_photos(struct sipe_core_private *sipe_private);