/[drupal]/contributions/modules/xmpp_server/includes/utility.php
ViewVC logotype

Diff of /contributions/modules/xmpp_server/includes/utility.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Thu Sep 25 06:45:42 2008 UTC revision 1.2, Fri Sep 26 00:45:43 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: utility.php,v 1.1 2008/09/25 06:45:42 t0talmeltd0wn Exp $
3    
4  /**  /**
5   * Loops through an array of objects or arrays looking for a match   * Loops through an array of objects or arrays looking for a match
# Line 59  function xmpp_get_uid_by_jid($jid) { Line 59  function xmpp_get_uid_by_jid($jid) {
59   *   The JID object, consisting of 'name', 'domain' and, optionally, 'resource'   *   The JID object, consisting of 'name', 'domain' and, optionally, 'resource'
60   *   fields.   *   fields.
61   * @param $bare   * @param $bare
62   *   If true, do not append the resource to the JID.   *   If false, render the full JID. If true, do not append the resource to the
63     *   JID. Otherwise, append a wildcard resource identifier.
64   * @return   * @return
65   *   The JID, serialized into a string.   *   The JID, serialized into a string.
66   */   */
67  function xmpp_serialize_jid($jid, $bare = false) {  function xmpp_serialize_jid($jid, $bare = false) {
68    if ($jid['resource'] && !$bare) {    if ($jid['resource'] && $bare === false) {
69      return "{$jid['name']}@{$jid['domain']}/{$jid['resource']}";      return "{$jid['name']}@{$jid['domain']}/{$jid['resource']}";
70    }    }
71    else {    elseif ($bare === true) {
72      return "{$jid['name']}@{$jid['domain']}";      return "{$jid['name']}@{$jid['domain']}";
73      } else {
74        return "{$jid['name']}@{$jid['domain']}/*";
75    }    }
76  }  }
77    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2