annotate src/gaim-client-example.c @ 11261:b53606580f68

[gaim-migrate @ 13439] Patch #1226486 from Levi Bard Fixes bug #1224178 If you change the topic in a chat room and that topic change is rejected, the topic field is wrong -- it shows the new topic even thought it didn't get set. This patch resets the GUI's topic immediately when you hit enter. Then, if the topic change is successful, the server will echo the topic change back to us and we'll update the GUI to the new topic. The only question is, does the server always echo the topic back to us? From the core's point of view, I'm ready to assume yes. It's the case for both IRC and Jabber*. If someone could test changing a topic in SILC or Zephyr, that'd be great. If servers using those protocols do not echo the topic back, the prpl will have to fake it as appropriate. * I didn't actually test on Jabber, but Nathan said the server will echo the topic change back. If it's broken, let me know. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sun, 14 Aug 2005 06:55:57 +0000
parents 66f872f30e40
children 421a8523ad04
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11241
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
1 #define DBUS_API_SUBJECT_TO_CHANGE
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
2
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
3 #include <stdio.h>
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
4 #include <stdlib.h>
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
5
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
6 #include "gaim-client.h"
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
7
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
8 /*
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
9 This example demonstrates how to use libgaim-client to communicate
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
10 with gaim. The names and signatures of functions provided by
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
11 libgaim-client are the same as those in gaim. However, all
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
12 structures (such as GaimAccount) are opaque, that is, you can only
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
13 use pointer to them. In fact, these pointers DO NOT actually point
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
14 to anything, they are just integer identifiers of assigned to these
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
15 structures by gaim. So NEVER try to dereference these pointers.
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
16 Integer ids as disguised as pointers to provide type checking and
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
17 prevent mistakes such as passing an id of GaimAccount when an id of
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
18 GaimBuddy is expected. According to glib manual, this technique is
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
19 portable.
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
20 */
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
21
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
22 int main (int argc, char **argv)
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
23 {
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
24 GaimAccount *account;
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
25 gaim_init();
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
26
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
27 account = gaim_accounts_find_any("", "");
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
28 g_print("Alias: %s\n", gaim_account_get_alias(account));
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
29
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
30 return 0;
66f872f30e40 [gaim-migrate @ 13404]
Piotr Zielinski <zielaj>
parents:
diff changeset
31 }