~ubuntu-branches/ubuntu/utopic/gossip/utopic

« back to all changes in this revision

Viewing changes to libgossip/gossip-message.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-10-17 11:15:38 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20061017111538-8dhxm4g1uoesb0hm
Tags: 0.18-0ubuntu1
* New upstream release:
  - Fixed "Fix crash in src/gossip-galago.c due to missing presence states"
  - Fixed "Fix white space bugs"
  - Fixed "Redesign adding a contact to a GtkDialog instead of GnomeDruid"
  - Fixed "Fix wrong linking order"
  - Fixed "Does not compile on Ubuntu Dapper Drake" 
  - Fixed "Scroll to contact name in history window" 
  - Fixed "The accounts dialog should use widget sets for known protocols"
  - Fixed "Contact information window should appear on the same desktop"
  - Fixed "Remove protocol specific instances of gossip_account_[set,get]_*"
  - Fixed "Use g_base64_[decode/encode] instead of our version"
  - Fixed "Bad glist usage, use g_list_prepend instead"
  - Fixed "Use GtkLinkButton instead of GnomeHRef"
  - Fixed "Gossip fails to build with Galago enabled"
  - Fixed "Gossip fails to build due to some errors in peekaboo-galago.c"
  - Fixed "Implement gossip_account_has_param()"
  - Fixed "Empty resource results in invalid JID used to send messages"
  - Translations: Updated el, nl, sv, ne, fi.
* debian/control.in:
  - bumped glib Build-Dep, dropped galago Build-Dep.
  - drop galago references.
* debian/rules:
  - drop --enable-galago.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
struct _GossipMessagePriv {
30
30
        GossipContact        *recipient;
31
31
        gchar                *resource;
32
 
        
 
32
 
33
33
        GossipContact        *sender;
34
34
 
35
35
        gchar                *subject;
39
39
        gossip_time_t         timestamp;
40
40
 
41
41
        GossipChatroomInvite *invite;
42
 
        
 
42
 
43
43
        gboolean              request_composing;
44
44
 
45
45
        GossipMessageType     type;
244
244
                      GParamSpec *pspec)
245
245
{
246
246
        GossipMessagePriv *priv;
247
 
        
 
247
 
248
248
        priv = GET_PRIV (object);
249
249
 
250
250
        switch (param_id) {
285
285
                      GParamSpec   *pspec)
286
286
{
287
287
        GossipMessagePriv *priv;
288
 
        
 
288
 
289
289
        priv = GET_PRIV (object);
290
290
 
291
291
        switch (param_id) {
326
326
}
327
327
 
328
328
GossipMessage *
329
 
gossip_message_new (GossipMessageType  type, 
 
329
gossip_message_new (GossipMessageType  type,
330
330
                    GossipContact     *recipient)
331
331
{
332
332
        return g_object_new (GOSSIP_TYPE_MESSAGE,
340
340
{
341
341
        GossipMessagePriv *priv;
342
342
 
343
 
        g_return_val_if_fail (GOSSIP_IS_MESSAGE (message), 
 
343
        g_return_val_if_fail (GOSSIP_IS_MESSAGE (message),
344
344
                              GOSSIP_MESSAGE_TYPE_NORMAL);
345
345
 
346
346
        priv = GET_PRIV (message);
347
 
        
 
347
 
348
348
        return priv->type;
349
349
}
350
350
 
373
373
 
374
374
        old_recipient = priv->recipient;
375
375
        priv->recipient = g_object_ref (contact);
376
 
        
 
376
 
377
377
        if (old_recipient) {
378
378
                g_object_unref (old_recipient);
379
379
        }
414
414
        g_object_notify (G_OBJECT (message), "resource");
415
415
}
416
416
 
417
 
GossipContact * 
 
417
GossipContact *
418
418
gossip_message_get_sender (GossipMessage *message)
419
419
{
420
420
        GossipMessagePriv *priv;
421
421
 
422
422
        g_return_val_if_fail (GOSSIP_IS_MESSAGE (message), NULL);
423
 
        
 
423
 
424
424
        priv = GET_PRIV (message);
425
425
 
426
426
        return priv->sender;
427
427
}
428
428
 
429
 
void 
 
429
void
430
430
gossip_message_set_sender (GossipMessage *message, GossipContact *contact)
431
431
{
432
432
        GossipMessagePriv *priv;
433
433
        GossipContact     *old_sender;
434
 
        
 
434
 
435
435
        g_return_if_fail (GOSSIP_IS_MESSAGE (message));
436
436
        g_return_if_fail (GOSSIP_IS_CONTACT (contact));
437
 
        
 
437
 
438
438
        priv = GET_PRIV (message);
439
439
 
440
440
        old_sender = priv->sender;
441
441
        priv->sender = g_object_ref (contact);
442
 
        
 
442
 
443
443
        if (old_sender) {
444
444
                g_object_unref (old_sender);
445
445
        }
446
 
        
 
446
 
447
447
        g_object_notify (G_OBJECT (message), "sender");
448
448
}
449
449
 
459
459
        return priv->subject;
460
460
}
461
461
 
462
 
void       
463
 
gossip_message_set_subject (GossipMessage *message, 
 
462
void
 
463
gossip_message_set_subject (GossipMessage *message,
464
464
                            const gchar   *subject)
465
465
{
466
466
        GossipMessagePriv *priv;
467
467
 
468
468
        g_return_if_fail (GOSSIP_IS_MESSAGE (message));
469
 
        
 
469
 
470
470
        priv = GET_PRIV (message);
471
471
 
472
472
        g_free (priv->subject);
492
492
        return priv->body;
493
493
}
494
494
 
495
 
void      
 
495
void
496
496
gossip_message_set_body (GossipMessage *message,
497
497
                         const gchar   *body)
498
498
{
499
499
        GossipMessagePriv *priv;
500
500
 
501
501
        g_return_if_fail (GOSSIP_IS_MESSAGE (message));
502
 
        
 
502
 
503
503
        priv = GET_PRIV (message);
504
504
 
505
505
        g_free (priv->body);
519
519
        GossipMessagePriv *priv;
520
520
 
521
521
        g_return_val_if_fail (GOSSIP_IS_MESSAGE (message), NULL);
522
 
        
 
522
 
523
523
        priv = GET_PRIV (message);
524
524
 
525
525
        return priv->thread;
526
526
}
527
527
 
528
 
void       
529
 
gossip_message_set_thread (GossipMessage *message, 
 
528
void
 
529
gossip_message_set_thread (GossipMessage *message,
530
530
                           const gchar   *thread)
531
531
{
532
532
        GossipMessagePriv *priv;
533
533
 
534
534
        g_return_if_fail (GOSSIP_IS_MESSAGE (message));
535
 
        
 
535
 
536
536
        priv = GET_PRIV (message);
537
537
 
538
538
        g_free (priv->thread);
550
550
gossip_message_get_timestamp (GossipMessage *message)
551
551
{
552
552
        GossipMessagePriv *priv;
553
 
        
 
553
 
554
554
        g_return_val_if_fail (GOSSIP_IS_MESSAGE (message), -1);
555
555
 
556
556
        priv = GET_PRIV (message);
559
559
}
560
560
 
561
561
void
562
 
gossip_message_set_timestamp (GossipMessage *message, 
 
562
gossip_message_set_timestamp (GossipMessage *message,
563
563
                              gossip_time_t  timestamp)
564
564
{
565
565
        GossipMessagePriv *priv;
566
 
        
 
566
 
567
567
        g_return_if_fail (GOSSIP_IS_MESSAGE (message));
568
568
        g_return_if_fail (timestamp >= -1);
569
569
 
584
584
        GossipMessagePriv *priv;
585
585
 
586
586
        g_return_val_if_fail (GOSSIP_IS_MESSAGE (message), NULL);
587
 
        
 
587
 
588
588
        priv = GET_PRIV (message);
589
589
 
590
590
        return priv->invite;
591
591
}
592
592
 
593
 
void       
594
 
gossip_message_set_invite (GossipMessage        *message, 
 
593
void
 
594
gossip_message_set_invite (GossipMessage        *message,
595
595
                           GossipChatroomInvite *invite)
596
596
{
597
597
        GossipMessagePriv    *priv;
598
598
        GossipChatroomInvite *old_invite;
599
599
 
600
600
        g_return_if_fail (GOSSIP_IS_MESSAGE (message));
601
 
        
 
601
 
602
602
        priv = GET_PRIV (message);
603
603
 
604
604
        old_invite = priv->invite;
605
 
        
 
605
 
606
606
        if (invite) {
607
607
                priv->invite = gossip_chatroom_invite_ref (invite);
608
608
        } else {
616
616
        g_object_notify (G_OBJECT (message), "invite");
617
617
}
618
618
 
619
 
void         
 
619
void
620
620
gossip_message_request_composing (GossipMessage *message)
621
621
{
622
622
        GossipMessagePriv *priv;
636
636
        GossipMessagePriv *priv;
637
637
 
638
638
        g_return_val_if_fail (GOSSIP_IS_MESSAGE (message), FALSE);
639
 
        
 
639
 
640
640
        priv = GET_PRIV (message);
641
641
 
642
642
        return priv->request_composing;