libpurple/purpleprotocolim.c

Mon, 13 Nov 2023 20:52:30 -0600

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Mon, 13 Nov 2023 20:52:30 -0600
changeset 42486
594f84a2c97f
parent 42305
a3895b6d3621
child 42594
eddde70cedd8
permissions
-rw-r--r--

Fix some small doc issues

- `Return Value` is deprecated.
- `See Also` is not a valid tag, and does not appear anywhere. If placed in the
description, then it does appear, but just like a regular paragraph, so write
it like one.
- Fix a few typos.

Testing Done:
Built docs.

Reviewed at https://reviews.imfreedom.org/r/2803/

40507
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * purple
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 *
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * source distribution.
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 *
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * (at your option) any later version.
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 *
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * GNU General Public License for more details.
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 *
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
40539
2941deda6d8d Use an https link to gnu.org in the license file headers
Gary Kramlich <grim@reaperworld.com>
parents: 40507
diff changeset
19 * along with this program; if not, see <https://www.gnu.org/licenses/>.
40507
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 */
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 #include "purpleprotocolim.h"
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 /******************************************************************************
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 * GObject Implementation
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 *****************************************************************************/
41024
a2ad2d034162 Set the prereq type for all Protocol interfaces to PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
27 G_DEFINE_INTERFACE(PurpleProtocolIM, purple_protocol_im, PURPLE_TYPE_PROTOCOL)
40507
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 static void
41960
c8a4853205e3 Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41024
diff changeset
30 purple_protocol_im_default_init(G_GNUC_UNUSED PurpleProtocolIMInterface *iface)
c8a4853205e3 Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41024
diff changeset
31 {
40507
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 }
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 /******************************************************************************
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 * Public API
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 *****************************************************************************/
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 gint
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 purple_protocol_im_send(PurpleProtocolIM *im, PurpleConnection *gc,
42305
a3895b6d3621 Add the conversation as a parameter to PurpleProtocolIM->send
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
39 PurpleConversation *conversation, PurpleMessage *msg)
40507
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 {
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 PurpleProtocolIMInterface *iface = NULL;
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 g_return_val_if_fail(PURPLE_IS_PROTOCOL_IM(im), -1);
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 iface = PURPLE_PROTOCOL_IM_GET_IFACE(im);
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 if(iface && iface->send) {
42305
a3895b6d3621 Add the conversation as a parameter to PurpleProtocolIM->send
Gary Kramlich <grim@reaperworld.com>
parents: 41960
diff changeset
47 return iface->send(im, gc, conversation, msg);
40507
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 }
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 return -1;
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 }
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 guint
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 purple_protocol_im_send_typing(PurpleProtocolIM *im, PurpleConnection *gc,
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 const gchar *name, PurpleIMTypingState state)
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 {
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 PurpleProtocolIMInterface *iface = NULL;
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 g_return_val_if_fail(PURPLE_IS_PROTOCOL_IM(im), 0);
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 iface = PURPLE_PROTOCOL_IM_GET_IFACE(im);
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 if(iface && iface->send_typing) {
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 return iface->send_typing(im, gc, name, state);
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 }
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 return 0;
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 }
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68

mercurial