Mon, 13 Jan 2025 02:36:10 -0600
Add some additional methods to Purple.ProtocolConversation
This adds virtual functions for setting the title and description as well as
some additional implements methods that we were missing.
Testing Done:
Ran the tests under valgrind and called in the turtles.
Bugs closed: PIDGIN-18026
Reviewed at https://reviews.imfreedom.org/r/3738/
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Pidgin - Internet Messenger |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION) |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | # error "only <pidgin.h> may be included directly" |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | #endif |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #ifndef PIDGIN_CONVERSATION_H |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #define PIDGIN_CONVERSATION_H |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | #include <glib.h> |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | #include <adwaita.h> |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | #include <gtk/gtk.h> |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | |
|
42943
d453240767f9
Create Pidgin.TypingLabel
Gary Kramlich <grim@reaperworld.com>
parents:
42620
diff
changeset
|
36 | #include <purple.h> |
|
d453240767f9
Create Pidgin.TypingLabel
Gary Kramlich <grim@reaperworld.com>
parents:
42620
diff
changeset
|
37 | |
|
42465
b7d530551c1b
Tag declared Pidgin types with symbol visibility
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42346
diff
changeset
|
38 | #include "pidginversion.h" |
|
b7d530551c1b
Tag declared Pidgin types with symbol visibility
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42346
diff
changeset
|
39 | |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | G_BEGIN_DECLS |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | /** |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | * PidginConversation: |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | * A [class@Gtk.Widget] for displaying a [class@Purple.Conversation]. |
|
42467
2b1d9d0770f2
Add Since and symbol visibility on remaining Pidgin API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42466
diff
changeset
|
46 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42467
diff
changeset
|
47 | * Since: 2.0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | */ |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | #define PIDGIN_TYPE_CONVERSATION (pidgin_conversation_get_type()) |
|
42465
b7d530551c1b
Tag declared Pidgin types with symbol visibility
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42346
diff
changeset
|
51 | |
|
b7d530551c1b
Tag declared Pidgin types with symbol visibility
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42346
diff
changeset
|
52 | PIDGIN_AVAILABLE_IN_3_0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | G_DECLARE_FINAL_TYPE(PidginConversation, pidgin_conversation, PIDGIN, |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | CONVERSATION, GtkBox) |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | /** |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | * pidgin_conversation_new: |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * @conversation: The [class@Purple.Conversation] to display. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | * Creates the user interface for @conversation and returns it. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | * Returns: (transfer full): The new widget. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42467
diff
changeset
|
64 | * Since: 3.0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
66 | PIDGIN_AVAILABLE_IN_3_0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | GtkWidget *pidgin_conversation_new(PurpleConversation *conversation); |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | /** |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | * pidgin_conversation_from_purple_conversation: |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | * @conversation: A [class@Purple.Conversation]. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | * Gets the [class@Pidgin.Conversation] that is displaying @conversation. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | * |
|
42315
e2475ff38c3d
Fix some warnings with the Pidgin docs
Gary Kramlich <grim@reaperworld.com>
parents:
42301
diff
changeset
|
75 | * Returns: (transfer none) (nullable): The [class@Pidgin.Conversation] displaying |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | * @conversation if one exists, otherwise %NULL. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42467
diff
changeset
|
78 | * Since: 3.0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
80 | PIDGIN_AVAILABLE_IN_3_0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | GtkWidget *pidgin_conversation_from_purple_conversation(PurpleConversation *conversation); |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | /** |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | * pidgin_conversation_get_conversation: |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | * @conversation: The instance. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | * Gets the [class@Purple.Conversation] that @conversation is displaying. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | * Returns: (transfer none): The [class@Purple.Conversation] that @conversation |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | * is displaying. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42467
diff
changeset
|
92 | * Since: 3.0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
94 | PIDGIN_AVAILABLE_IN_3_0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | PurpleConversation *pidgin_conversation_get_conversation(PidginConversation *conversation); |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | /** |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | * pidgin_conversation_close: |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | * @conversation: The instance. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | * |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | * Close @conversation. This only closes the user interface portion of the |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | * conversation and the user may remain in the conversation if the protocol |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | * supports it. |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | * |
|
42620
72178a341eb8
Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42467
diff
changeset
|
105 | * Since: 3.0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | */ |
|
42466
ca3374c1cdba
Add visibility to all Pidgin symbols tagged with Since 3.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42465
diff
changeset
|
107 | PIDGIN_AVAILABLE_IN_3_0 |
|
42301
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | void pidgin_conversation_close(PidginConversation *conversation); |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | G_END_DECLS |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | |
|
d3930fe5505c
The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | #endif /* PIDGIN_CONVERSATION_H */ |