Skip to content

Instantly share code, notes, and snippets.

@bitops
Last active November 14, 2019 20:09
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bitops/77308b347bceb54302a2 to your computer and use it in GitHub Desktop.
HipChat + jabber.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; use jabber-connect to connect. Make sure you tab to select the hipchat account if it's the ;;
;; only connection configured. ;;
;; ;;
;; a fork of https://gist.github.com/puffnfresh/4002033 ;;
;; ;;
;; shout out to http://emacs.stackexchange.com/questions/10940/connecting-to-hipchat-xmpp-via-jabber-el ;;
;; for the help. ;;
;; ;;
;; you can look up the necessary jabber info on the account info page in hipchat ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq ssl-program-name "gnutls-cli"
ssl-program-arguments '("--insecure" "-p" service host)
ssl-certificate-verification-policy 1)
(setq jabber-history-enabled t)
(setq jabber-account-list '(
("your-hipchat-id@chat.hipchat.com"
(:port . 5223)
(:password . "your-password-here")
(:connection-type . ssl)
)))
;; this info is present on the hipchat xmpp info page
(defvar hipchat-room-list '(
("Human friendly name" . "hipchat_jabber_mapping")
("Room One" . "room_one")
))
;; To join HipChat rooms easily
(defvar hipchat-number "12345")
(defvar hipchat-nickname "Foo Bar")
(defun hipchat-join ()
(interactive)
(let* ((room-list (sort (mapcar 'car hipchat-room-list) 'string-lessp))
(selected-room (completing-read "Room name: " room-list))
(hipchat-mapping (cdr (assoc selected-room hipchat-room-list))))
(jabber-groupchat-join
(jabber-read-account)
(concat hipchat-number "_" hipchat-mapping "@conf.hipchat.com")
hipchat-nickname
t)))
(provide 'hipchat)
@dermusikman
Copy link

To what do the hipchat-number and hipchat-nickname refer? One's own number? That's unclear to me, and it's apparently preventing successful joining of rooms

@agzam
Copy link

agzam commented Jul 22, 2015

Yeah I can't join rooms either. Maybe hipchat guys changed something. Can someone show how to fix hipchat-join function?

Copy link

ghost commented Aug 13, 2015

Hipchat nickname is your "username" more or less from a jabber standpoint I think. It has to be what is shown in your hipchat client or it won't work.

Hipchat number appears to be the part before the underscore in username here: https://intoximeters.hipchat.com/account/xmpp.

@egh
Copy link

egh commented Sep 11, 2015

my version https://gist.github.com/egh/5f46b5d6d2061f305b46 - allows interactive room selection!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment